{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Classification\n",
    "\n",
    "In this lecture, I will bring together various techniques for feature engineering that we have covered in this course to tackle a classification problem. This would give you an idea of the end-to-end pipeline to build machine learning algorithms for classification.\n",
    "\n",
    "============================================================================\n",
    "\n",
    "## Real Life example: \n",
    "\n",
    "### Predicting Survival on the Titanic: understanding society behaviour and beliefs\n",
    "\n",
    "Perhaps one of the most infamous shipwrecks in history, the Titanic sank after colliding with an iceberg, killing 1502 out of 2224 people on board. Interestingly, by analysing the probability of survival based on few attributes like gender, age, and social status, we can make very accurate predictions on which passengers would survive. Some groups of people were more likely to survive than others, such as women, children, and the upper-class. Therefore, we can learn about the society priorities and privileges at the time.\n",
    "\n",
    "====================================================================================================\n",
    "\n",
    "To download the Titanic data, go ahead to this website:\n",
    "https://www.kaggle.com/c/titanic/data\n",
    "\n",
    "Click on the link 'train.csv', and then click the 'download' blue button towards the right of the screen, to download the dataset. Save it in a folder of your choice.\n",
    "\n",
    "**Note that you need to be logged in to Kaggle in order to download the datasets**.\n",
    "\n",
    "If you save it in the same directory from which you are running this notebook, and you rename the file to 'titanic.csv' then you can load it the same way I will load it below.\n",
    "\n",
    "===================================================================================================="
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Titanic dataset"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# to handle datasets\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "\n",
    "# for text / string processing\n",
    "import re\n",
    "\n",
    "# for plotting\n",
    "import matplotlib.pyplot as plt\n",
    "% matplotlib inline\n",
    "\n",
    "# to divide train and test set\n",
    "from sklearn.model_selection import train_test_split\n",
    "\n",
    "# feature scaling\n",
    "from sklearn.preprocessing import MinMaxScaler\n",
    "\n",
    "# for tree binarisation\n",
    "from sklearn.tree import DecisionTreeClassifier\n",
    "from sklearn.model_selection import cross_val_score\n",
    "\n",
    "\n",
    "# to build the models\n",
    "from sklearn.linear_model import LogisticRegression\n",
    "from sklearn.ensemble import AdaBoostClassifier\n",
    "from sklearn.ensemble import RandomForestClassifier\n",
    "import xgboost as xgb\n",
    "\n",
    "# to evaluate the models\n",
    "from sklearn.metrics import roc_auc_score\n",
    "from sklearn import metrics\n",
    "\n",
    "pd.pandas.set_option('display.max_columns', None)\n",
    "\n",
    "import warnings\n",
    "warnings.filterwarnings('ignore')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>PassengerId</th>\n",
       "      <th>Survived</th>\n",
       "      <th>Pclass</th>\n",
       "      <th>Name</th>\n",
       "      <th>Sex</th>\n",
       "      <th>Age</th>\n",
       "      <th>SibSp</th>\n",
       "      <th>Parch</th>\n",
       "      <th>Ticket</th>\n",
       "      <th>Fare</th>\n",
       "      <th>Cabin</th>\n",
       "      <th>Embarked</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Braund, Mr. Owen Harris</td>\n",
       "      <td>male</td>\n",
       "      <td>22.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>A/5 21171</td>\n",
       "      <td>7.2500</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>Cumings, Mrs. John Bradley (Florence Briggs Th...</td>\n",
       "      <td>female</td>\n",
       "      <td>38.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>PC 17599</td>\n",
       "      <td>71.2833</td>\n",
       "      <td>C85</td>\n",
       "      <td>C</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>Heikkinen, Miss. Laina</td>\n",
       "      <td>female</td>\n",
       "      <td>26.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>STON/O2. 3101282</td>\n",
       "      <td>7.9250</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>Futrelle, Mrs. Jacques Heath (Lily May Peel)</td>\n",
       "      <td>female</td>\n",
       "      <td>35.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>113803</td>\n",
       "      <td>53.1000</td>\n",
       "      <td>C123</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Allen, Mr. William Henry</td>\n",
       "      <td>male</td>\n",
       "      <td>35.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>373450</td>\n",
       "      <td>8.0500</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   PassengerId  Survived  Pclass  \\\n",
       "0            1         0       3   \n",
       "1            2         1       1   \n",
       "2            3         1       3   \n",
       "3            4         1       1   \n",
       "4            5         0       3   \n",
       "\n",
       "                                                Name     Sex   Age  SibSp  \\\n",
       "0                            Braund, Mr. Owen Harris    male  22.0      1   \n",
       "1  Cumings, Mrs. John Bradley (Florence Briggs Th...  female  38.0      1   \n",
       "2                             Heikkinen, Miss. Laina  female  26.0      0   \n",
       "3       Futrelle, Mrs. Jacques Heath (Lily May Peel)  female  35.0      1   \n",
       "4                           Allen, Mr. William Henry    male  35.0      0   \n",
       "\n",
       "   Parch            Ticket     Fare Cabin Embarked  \n",
       "0      0         A/5 21171   7.2500   NaN        S  \n",
       "1      0          PC 17599  71.2833   C85        C  \n",
       "2      0  STON/O2. 3101282   7.9250   NaN        S  \n",
       "3      0            113803  53.1000  C123        S  \n",
       "4      0            373450   8.0500   NaN        S  "
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# load dataset\n",
    "data = pd.read_csv('titanic.csv')\n",
    "data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>PassengerId</th>\n",
       "      <th>Pclass</th>\n",
       "      <th>Name</th>\n",
       "      <th>Sex</th>\n",
       "      <th>Age</th>\n",
       "      <th>SibSp</th>\n",
       "      <th>Parch</th>\n",
       "      <th>Ticket</th>\n",
       "      <th>Fare</th>\n",
       "      <th>Cabin</th>\n",
       "      <th>Embarked</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>892</td>\n",
       "      <td>3</td>\n",
       "      <td>Kelly, Mr. James</td>\n",
       "      <td>male</td>\n",
       "      <td>34.5</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>330911</td>\n",
       "      <td>7.8292</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Q</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>893</td>\n",
       "      <td>3</td>\n",
       "      <td>Wilkes, Mrs. James (Ellen Needs)</td>\n",
       "      <td>female</td>\n",
       "      <td>47.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>363272</td>\n",
       "      <td>7.0000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>894</td>\n",
       "      <td>2</td>\n",
       "      <td>Myles, Mr. Thomas Francis</td>\n",
       "      <td>male</td>\n",
       "      <td>62.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>240276</td>\n",
       "      <td>9.6875</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Q</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>895</td>\n",
       "      <td>3</td>\n",
       "      <td>Wirz, Mr. Albert</td>\n",
       "      <td>male</td>\n",
       "      <td>27.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>315154</td>\n",
       "      <td>8.6625</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>896</td>\n",
       "      <td>3</td>\n",
       "      <td>Hirvonen, Mrs. Alexander (Helga E Lindqvist)</td>\n",
       "      <td>female</td>\n",
       "      <td>22.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>3101298</td>\n",
       "      <td>12.2875</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   PassengerId  Pclass                                          Name     Sex  \\\n",
       "0          892       3                              Kelly, Mr. James    male   \n",
       "1          893       3              Wilkes, Mrs. James (Ellen Needs)  female   \n",
       "2          894       2                     Myles, Mr. Thomas Francis    male   \n",
       "3          895       3                              Wirz, Mr. Albert    male   \n",
       "4          896       3  Hirvonen, Mrs. Alexander (Helga E Lindqvist)  female   \n",
       "\n",
       "    Age  SibSp  Parch   Ticket     Fare Cabin Embarked  \n",
       "0  34.5      0      0   330911   7.8292   NaN        Q  \n",
       "1  47.0      1      0   363272   7.0000   NaN        S  \n",
       "2  62.0      0      0   240276   9.6875   NaN        Q  \n",
       "3  27.0      0      0   315154   8.6625   NaN        S  \n",
       "4  22.0      1      1  3101298  12.2875   NaN        S  "
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Load the dataset for submission (the one on which our model will be evaluated by Kaggle)\n",
    "# it contains exactly the same variables, but not the target\n",
    "\n",
    "submission = pd.read_csv('titanic_submission.csv')\n",
    "submission.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Types of variables (section 2)\n",
    "\n",
    "Let's go ahead and find out what types of variables there are in this dataset"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "PassengerId      int64\n",
       "Survived         int64\n",
       "Pclass           int64\n",
       "Name            object\n",
       "Sex             object\n",
       "Age            float64\n",
       "SibSp            int64\n",
       "Parch            int64\n",
       "Ticket          object\n",
       "Fare           float64\n",
       "Cabin           object\n",
       "Embarked        object\n",
       "dtype: object"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# let's inspect the type of variables in pandas\n",
    "data.dtypes"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "There are a mixture of categorical and numerical variables. Numerical are those of type int and float. Categorical those of type object."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Number of PassengerId labels:  891\n",
      "Number  of passengers on the Titanic:  891\n"
     ]
    }
   ],
   "source": [
    "print('Number of PassengerId labels: ', len(data.PassengerId.unique()))\n",
    "print('Number  of passengers on the Titanic: ', len(data))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "PassengerId is a unique identifier for each of the passengers. Thus this is not a variable that we can use."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "There are 5 categorical variables\n"
     ]
    }
   ],
   "source": [
    "# find categorical variables\n",
    "categorical = [var for var in data.columns if data[var].dtype=='O']\n",
    "print('There are {} categorical variables'.format(len(categorical)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "There are 7 numerical variables\n"
     ]
    }
   ],
   "source": [
    "# find numerical variables\n",
    "numerical = [var for var in data.columns if data[var].dtype!='O']\n",
    "print('There are {} numerical variables'.format(len(numerical)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Name</th>\n",
       "      <th>Sex</th>\n",
       "      <th>Ticket</th>\n",
       "      <th>Cabin</th>\n",
       "      <th>Embarked</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Braund, Mr. Owen Harris</td>\n",
       "      <td>male</td>\n",
       "      <td>A/5 21171</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Cumings, Mrs. John Bradley (Florence Briggs Th...</td>\n",
       "      <td>female</td>\n",
       "      <td>PC 17599</td>\n",
       "      <td>C85</td>\n",
       "      <td>C</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Heikkinen, Miss. Laina</td>\n",
       "      <td>female</td>\n",
       "      <td>STON/O2. 3101282</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Futrelle, Mrs. Jacques Heath (Lily May Peel)</td>\n",
       "      <td>female</td>\n",
       "      <td>113803</td>\n",
       "      <td>C123</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Allen, Mr. William Henry</td>\n",
       "      <td>male</td>\n",
       "      <td>373450</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                Name     Sex  \\\n",
       "0                            Braund, Mr. Owen Harris    male   \n",
       "1  Cumings, Mrs. John Bradley (Florence Briggs Th...  female   \n",
       "2                             Heikkinen, Miss. Laina  female   \n",
       "3       Futrelle, Mrs. Jacques Heath (Lily May Peel)  female   \n",
       "4                           Allen, Mr. William Henry    male   \n",
       "\n",
       "             Ticket Cabin Embarked  \n",
       "0         A/5 21171   NaN        S  \n",
       "1          PC 17599   C85        C  \n",
       "2  STON/O2. 3101282   NaN        S  \n",
       "3            113803  C123        S  \n",
       "4            373450   NaN        S  "
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# view of categorical variables\n",
    "data[categorical].head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- 2 potential mixed type of variables: Cabin and Ticket\n",
    "\n",
    "Cabin and Ticket contain both numbers and letters. We could extract the numerical part and then the non-numerical part and generate 2 variables out of them, to see if that adds value to our predictive models."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>PassengerId</th>\n",
       "      <th>Survived</th>\n",
       "      <th>Pclass</th>\n",
       "      <th>Age</th>\n",
       "      <th>SibSp</th>\n",
       "      <th>Parch</th>\n",
       "      <th>Fare</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>22.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>7.2500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>38.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>71.2833</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>26.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7.9250</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>35.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>53.1000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>35.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>8.0500</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   PassengerId  Survived  Pclass   Age  SibSp  Parch     Fare\n",
       "0            1         0       3  22.0      1      0   7.2500\n",
       "1            2         1       1  38.0      1      0  71.2833\n",
       "2            3         1       3  26.0      0      0   7.9250\n",
       "3            4         1       1  35.0      1      0  53.1000\n",
       "4            5         0       3  35.0      0      0   8.0500"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# view of numerical variables\n",
    "data[numerical].head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- 3 Discrete variables: Pclass, SibSp and Parch\n",
    "- 2 continuous variables: Fare and Age\n",
    "- 1 Id variable: PassengerId (it is a label for each of the passengers)\n",
    "- 1 binary: Survived (target variable)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Pclass  values:  [3 1 2]\n",
      "SibSp  values:  [1 0 3 4 2 5 8]\n",
      "Parch  values:  [0 1 2 5 3 4 6]\n"
     ]
    }
   ],
   "source": [
    "# let's visualise the values of the discrete variables\n",
    "for var in ['Pclass',  'SibSp', 'Parch']:\n",
    "    print(var, ' values: ', data[var].unique())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Types of variables, summary:\n",
    "\n",
    "- 5 categorical variables: from them 2 could be treated as mixed type of variables (numbers and strings)\n",
    "- 7 numerical variables: 3 discrete, 2 continuous, 1 Id, and 1 binary target"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Types of problems within the variables (section 3)\n",
    "\n",
    "#### Missing values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "PassengerId    0.000000\n",
       "Survived       0.000000\n",
       "Pclass         0.000000\n",
       "Name           0.000000\n",
       "Sex            0.000000\n",
       "Age            0.198653\n",
       "SibSp          0.000000\n",
       "Parch          0.000000\n",
       "Ticket         0.000000\n",
       "Fare           0.000000\n",
       "Cabin          0.771044\n",
       "Embarked       0.002245\n",
       "dtype: float64"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# let's visualise the percentage of missing values\n",
    "data.isnull().mean()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Three of the variables contain missing data, Age (~20%), Cabin (~77%) and Embarked (< 1%)\n",
    "\n",
    "#### Outliers"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Pclass', 'Age', 'SibSp', 'Parch', 'Fare']"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "numerical = [var for var in numerical if var not in['Survived', 'PassengerId']]\n",
    "numerical"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.text.Text at 0x8b75e20898>"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGg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UizgLeAvxry50kSZJOlmfwJEmSJKlFeA+eJEmSJLUIC54kSZIktQgLniRJkiS1CAueJEmS\nJLUIC54kSZIktQgLniRJkiS1iP8fVCRdtOetPG4AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x8b759e4748>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# let's make boxplots to visualise outliers in the continuous variables \n",
    "# Age and Fare\n",
    "\n",
    "plt.figure(figsize=(15,6))\n",
    "plt.subplot(1, 2, 1)\n",
    "fig = data.boxplot(column='Age')\n",
    "fig.set_title('')\n",
    "fig.set_ylabel('Age')\n",
    "\n",
    "plt.subplot(1, 2, 2)\n",
    "fig = data.boxplot(column='Fare')\n",
    "fig.set_title('')\n",
    "fig.set_ylabel('Fare')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Both Age and Fare contain outliers. Let's find which valuers are the outliers"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.text.Text at 0x8b760fe1d0>"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA38AAAF3CAYAAAAVe/LLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X2UXHd95/n3B9kBYcDYA+lRbAc5s4KMjZYnxSGQw3Zw\nCCYmmMMwHrGGI3O8o+zGE0xGu0EmD5DN8Y5mM2bDMGESBRhEwtoxBGKBGRKjoclyNoufcCI/4LHB\nMtgjWwyZAHKCiezv/lFXVresh+qurqp7+75f5/TpW7+qW/Wpn0v+1rfvU6oKSZIkSdLK9qRpB5Ak\nSZIkjZ/NnyRJkiT1gM2fJEmSJPWAzZ8kSZIk9YDNnyRJkiT1gM2fJEmSJPWAzZ8kSZIk9YDNnyRJ\nk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JEnq\nAZs/SZIkSeoBmz9JkiRJ6gGbP0mSJEnqAZs/SZIkSeqB/x+5QtZKy9en8gAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x8b760a9438>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# first we plot the distributions to find out if they are Gaussian or skewed.\n",
    "# Depending on the distribution, we will use the normal assumption or the interquantile\n",
    "# range to find outliers\n",
    "\n",
    "plt.figure(figsize=(15,6))\n",
    "plt.subplot(1, 2, 1)\n",
    "fig = data.Age.hist(bins=20)\n",
    "fig.set_ylabel('Number of passengers')\n",
    "fig.set_xlabel('Age')\n",
    "\n",
    "plt.subplot(1, 2, 2)\n",
    "fig = data.Fare.hist(bins=20)\n",
    "fig.set_ylabel('Number of passengers')\n",
    "fig.set_xlabel('Fare')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Age is quite Gaussian and Fare is skewed, so I will use the Gaussian assumption for Age, and the interquantile range for Fare"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Age outliers are values < -13.88037434994331 or > 73.27860964406095\n",
      "Fare outliers are values < -61.358399999999996 or > 100.2688\n"
     ]
    }
   ],
   "source": [
    "# find outliers\n",
    "\n",
    "# Age\n",
    "Upper_boundary = data.Age.mean() + 3* data.Age.std()\n",
    "Lower_boundary = data.Age.mean() - 3* data.Age.std()\n",
    "print('Age outliers are values < {lowerboundary} or > {upperboundary}'.format(lowerboundary=Lower_boundary, upperboundary=Upper_boundary))\n",
    "\n",
    "# Fare\n",
    "IQR = data.Fare.quantile(0.75) - data.Fare.quantile(0.25)\n",
    "Lower_fence = data.Fare.quantile(0.25) - (IQR * 3)\n",
    "Upper_fence = data.Fare.quantile(0.75) + (IQR * 3)\n",
    "print('Fare outliers are values < {lowerboundary} or > {upperboundary}'.format(lowerboundary=Lower_fence, upperboundary=Upper_fence))\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We  should remove from the dataset Ages > 73 or Fares > 100.\n",
    "\n",
    "There are a few methods to handle outliers, one is top-coding, the other one is discretisation of variables. **I will use top-coding for Age, and discretisation for Fare**.\n",
    "\n",
    "#### Outlies in discrete variables\n",
    "\n",
    "Let's calculate the percentage of passengers for each  of the values that can take the discrete variables in the titanic dataset. I will call outliers, those values that are present in less than 1% of the passengers. This is exactly the same as finding rare labels in categorical variables. Discrete variables, in essence can be pre-processed / engineered as if they were categorical. Keep this in mind."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "3    0.551066\n",
      "1    0.242424\n",
      "2    0.206510\n",
      "Name: Pclass, dtype: float64\n",
      "\n",
      "0    0.682379\n",
      "1    0.234568\n",
      "2    0.031425\n",
      "4    0.020202\n",
      "3    0.017957\n",
      "8    0.007856\n",
      "5    0.005612\n",
      "Name: SibSp, dtype: float64\n",
      "\n",
      "0    0.760943\n",
      "1    0.132435\n",
      "2    0.089787\n",
      "5    0.005612\n",
      "3    0.005612\n",
      "4    0.004489\n",
      "6    0.001122\n",
      "Name: Parch, dtype: float64\n",
      "\n"
     ]
    }
   ],
   "source": [
    "# outlies in discrete variables\n",
    "for var in ['Pclass',  'SibSp', 'Parch']:\n",
    "    print(data[var].value_counts() / np.float(len(data)))\n",
    "    print()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Pclass** does not contain outliers, as all its numbers are present in at least 20% of the passengers.\n",
    "\n",
    "**SibSp**\n",
    "This variable indicates the number of of siblings / spouses aboard the Titanic. Values bigger than 4, are rare. So I will cap this variable at 4 (top coding).\n",
    "\n",
    "**Parch** \n",
    "This variable indicates the number of parents / children aboard the Titanic. We can see that values > 2 are rare (present in less than 1% of passengers). Thus I will cap this variable at 2 (top-coding).\n",
    "\n",
    "\n",
    "#### Number of labels: cardinality"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Name  contains  891  labels\n",
      "Sex  contains  2  labels\n",
      "Ticket  contains  681  labels\n",
      "Cabin  contains  148  labels\n",
      "Embarked  contains  4  labels\n"
     ]
    }
   ],
   "source": [
    "for var in categorical:\n",
    "    print(var, ' contains ', len(data[var].unique()), ' labels')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The variables Name, Ticket and Cabin are highly cardinal, i.e., they contain a lot of labels. In addition, those variables are not usable as such, and they require some manual preprocessing. I will do that before proceeding with the data exploration"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Pre-processing of mixed type of variables (section 11)\n",
    "\n",
    "The variables Cabin and Ticket contain both numbers and letters. Let's create 2 variables for each extracting the numerical and categorical part."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Cabin</th>\n",
       "      <th>Cabin_numerical</th>\n",
       "      <th>Cabin_categorical</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>C85</td>\n",
       "      <td>85.0</td>\n",
       "      <td>C</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>C123</td>\n",
       "      <td>123.0</td>\n",
       "      <td>C</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  Cabin  Cabin_numerical Cabin_categorical\n",
       "0   NaN              NaN               NaN\n",
       "1   C85             85.0                 C\n",
       "2   NaN              NaN               NaN\n",
       "3  C123            123.0                 C\n",
       "4   NaN              NaN               NaN"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Cabin\n",
    "data['Cabin_numerical'] = data.Cabin.str.extract('(\\d+)') # extracts number from string\n",
    "data['Cabin_numerical'] = data['Cabin_numerical'].astype('float') # parses the above variable to float type\n",
    "\n",
    "data['Cabin_categorical'] = data['Cabin'].str[0] # captures first letter of string (the letter of the cabin)\n",
    "\n",
    "# same for submission data\n",
    "submission['Cabin_numerical'] = submission.Cabin.str.extract('(\\d+)')\n",
    "submission['Cabin_numerical'] = submission['Cabin_numerical'].astype('float')\n",
    "\n",
    "submission['Cabin_categorical'] = submission['Cabin'].str[0]\n",
    "\n",
    "data[['Cabin', 'Cabin_numerical', 'Cabin_categorical']].head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# drop the original variable\n",
    "data.drop(labels='Cabin', inplace=True, axis=1)\n",
    "submission.drop(labels='Cabin', inplace=True, axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Ticket</th>\n",
       "      <th>Ticket_numerical</th>\n",
       "      <th>Ticket_categorical</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>A/5 21171</td>\n",
       "      <td>21171.0</td>\n",
       "      <td>A/5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>PC 17599</td>\n",
       "      <td>17599.0</td>\n",
       "      <td>PC</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>STON/O2. 3101282</td>\n",
       "      <td>3101282.0</td>\n",
       "      <td>STON/O2.</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>113803</td>\n",
       "      <td>113803.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>373450</td>\n",
       "      <td>373450.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             Ticket  Ticket_numerical Ticket_categorical\n",
       "0         A/5 21171           21171.0                A/5\n",
       "1          PC 17599           17599.0                 PC\n",
       "2  STON/O2. 3101282         3101282.0           STON/O2.\n",
       "3            113803          113803.0                NaN\n",
       "4            373450          373450.0                NaN"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#  Ticket\n",
    "# extract the last bit of ticket as number\n",
    "data['Ticket_numerical'] = data.Ticket.apply(lambda s: s.split()[-1])\n",
    "data['Ticket_numerical'] = np.where(data.Ticket_numerical.str.isdigit(), data.Ticket_numerical, np.nan)\n",
    "data['Ticket_numerical'] = data['Ticket_numerical'].astype('float')\n",
    "\n",
    "# extract the first part of ticket as category\n",
    "data['Ticket_categorical'] = data.Ticket.apply(lambda s: s.split()[0])\n",
    "data['Ticket_categorical'] = np.where(data.Ticket_categorical.str.isdigit(), np.nan, data.Ticket_categorical)\n",
    "\n",
    "# submission\n",
    "submission['Ticket_numerical'] = submission.Ticket.apply(lambda s: s.split()[-1])\n",
    "submission['Ticket_numerical'] = np.where(submission.Ticket_numerical.str.isdigit(), submission.Ticket_numerical, np.nan)\n",
    "submission['Ticket_numerical'] = submission['Ticket_numerical'].astype('float')\n",
    "\n",
    "# extract the first part of ticket as category\n",
    "submission['Ticket_categorical'] = submission.Ticket.apply(lambda s: s.split()[0])\n",
    "submission['Ticket_categorical'] = np.where(submission.Ticket_categorical.str.isdigit(), np.nan, submission.Ticket_categorical)\n",
    "\n",
    "data[['Ticket', 'Ticket_numerical', 'Ticket_categorical']].head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['A/5', 'PC', 'STON/O2.', nan, 'PP', 'A/5.', 'C.A.', 'A./5.',\n",
       "       'SC/Paris', 'S.C./A.4.', 'A/4.', 'CA', 'S.P.', 'S.O.C.', 'SO/C',\n",
       "       'W./C.', 'SOTON/OQ', 'W.E.P.', 'STON/O', 'A4.', 'C', 'SOTON/O.Q.',\n",
       "       'SC/PARIS', 'S.O.P.', 'A.5.', 'Fa', 'CA.', 'LINE', 'F.C.C.', 'W/C',\n",
       "       'SW/PP', 'SCO/W', 'P/PP', 'SC', 'SC/AH', 'A/S', 'A/4', 'WE/P',\n",
       "       'S.W./PP', 'S.O./P.P.', 'F.C.', 'SOTON/O2', 'S.C./PARIS',\n",
       "       'C.A./SOTON'], dtype=object)"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# let's explore the ticket categorical part a bit further\n",
    "data.Ticket_categorical.unique()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Ticket_categorical</th>\n",
       "      <th>Ticket_categorical</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>A</td>\n",
       "      <td>A/5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>PC</td>\n",
       "      <td>PC</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>STONO</td>\n",
       "      <td>STON/O2.</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>PP</td>\n",
       "      <td>PP</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>A</td>\n",
       "      <td>A/5.</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>861</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>862</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>863</th>\n",
       "      <td>CA</td>\n",
       "      <td>CA.</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>864</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>865</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>866</th>\n",
       "      <td>SCPARIS</td>\n",
       "      <td>SC/PARIS</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>867</th>\n",
       "      <td>PC</td>\n",
       "      <td>PC</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>868</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>869</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>870</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>871</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>872</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>873</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>874</th>\n",
       "      <td>PPP</td>\n",
       "      <td>P/PP</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>875</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>876</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>877</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>878</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>879</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>880</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>881</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>882</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>883</th>\n",
       "      <td>CASOTON</td>\n",
       "      <td>C.A./SOTON</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>884</th>\n",
       "      <td>SOTONOQ</td>\n",
       "      <td>SOTON/OQ</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>885</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>886</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>887</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>888</th>\n",
       "      <td>WC</td>\n",
       "      <td>W./C.</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>889</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>890</th>\n",
       "      <td>nan</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>891 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    Ticket_categorical Ticket_categorical\n",
       "0                    A                A/5\n",
       "1                   PC                 PC\n",
       "2                STONO           STON/O2.\n",
       "3                  nan                NaN\n",
       "4                  nan                NaN\n",
       "5                  nan                NaN\n",
       "6                  nan                NaN\n",
       "7                  nan                NaN\n",
       "8                  nan                NaN\n",
       "9                  nan                NaN\n",
       "10                  PP                 PP\n",
       "11                 nan                NaN\n",
       "12                   A               A/5.\n",
       "13                 nan                NaN\n",
       "14                 nan                NaN\n",
       "15                 nan                NaN\n",
       "16                 nan                NaN\n",
       "17                 nan                NaN\n",
       "18                 nan                NaN\n",
       "19                 nan                NaN\n",
       "20                 nan                NaN\n",
       "21                 nan                NaN\n",
       "22                 nan                NaN\n",
       "23                 nan                NaN\n",
       "24                 nan                NaN\n",
       "25                 nan                NaN\n",
       "26                 nan                NaN\n",
       "27                 nan                NaN\n",
       "28                 nan                NaN\n",
       "29                 nan                NaN\n",
       "..                 ...                ...\n",
       "861                nan                NaN\n",
       "862                nan                NaN\n",
       "863                 CA                CA.\n",
       "864                nan                NaN\n",
       "865                nan                NaN\n",
       "866            SCPARIS           SC/PARIS\n",
       "867                 PC                 PC\n",
       "868                nan                NaN\n",
       "869                nan                NaN\n",
       "870                nan                NaN\n",
       "871                nan                NaN\n",
       "872                nan                NaN\n",
       "873                nan                NaN\n",
       "874                PPP               P/PP\n",
       "875                nan                NaN\n",
       "876                nan                NaN\n",
       "877                nan                NaN\n",
       "878                nan                NaN\n",
       "879                nan                NaN\n",
       "880                nan                NaN\n",
       "881                nan                NaN\n",
       "882                nan                NaN\n",
       "883            CASOTON         C.A./SOTON\n",
       "884            SOTONOQ           SOTON/OQ\n",
       "885                nan                NaN\n",
       "886                nan                NaN\n",
       "887                nan                NaN\n",
       "888                 WC              W./C.\n",
       "889                nan                NaN\n",
       "890                nan                NaN\n",
       "\n",
       "[891 rows x 2 columns]"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# it contains several labels, some of them seem very similar apart from the punctuation\n",
    "# I will try to reduce this number of labels a bit further\n",
    "\n",
    "# remove non letter characters from string\n",
    "text = data.Ticket_categorical.apply(lambda x: re.sub(\"[^a-zA-Z]\", '', str(x)))\n",
    "\n",
    "# to visualise the output and compare with input\n",
    "pd.concat([text, data.Ticket_categorical], axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['A', 'PC', 'STONO', 'NAN', 'PP', 'CA', 'SCPARIS', 'SCA', 'SP',\n",
       "       'SOC', 'WC', 'SOTONOQ', 'WEP', 'C', 'SOP', 'FA', 'LINE', 'FCC',\n",
       "       'SWPP', 'SCOW', 'PPP', 'SC', 'SCAH', 'AS', 'SOPP', 'FC', 'SOTONO',\n",
       "       'CASOTON'], dtype=object)"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# set to upper case: we reduce the number of labels quite a bit\n",
    "text = text.str.upper()\n",
    "text.unique()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# process the variable in submission as well\n",
    "data['Ticket_categorical'] = text\n",
    "\n",
    "submission['Ticket_categorical'] = submission.Ticket_categorical.apply(lambda x: re.sub(\"[^a-zA-Z]\", '', str(x)))\n",
    "submission['Ticket_categorical'] = submission['Ticket_categorical'].str.upper()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# drop the original variable\n",
    "data.drop(labels='Ticket', inplace=True, axis=1)\n",
    "submission.drop(labels='Ticket', inplace=True, axis=1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Bonus: tailored preprocessing for the Titanic dataset\n",
    "\n",
    "The variable Name contains 891 different values, one for each of the passengers. We wouldn't be able to use this variable as is. However, we can extract some data from it, for example the title. See below."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Name</th>\n",
       "      <th>Title</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Braund, Mr. Owen Harris</td>\n",
       "      <td>Mr</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Cumings, Mrs. John Bradley (Florence Briggs Th...</td>\n",
       "      <td>Mrs</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Heikkinen, Miss. Laina</td>\n",
       "      <td>Miss</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Futrelle, Mrs. Jacques Heath (Lily May Peel)</td>\n",
       "      <td>Mrs</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Allen, Mr. William Henry</td>\n",
       "      <td>Mr</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                Name Title\n",
       "0                            Braund, Mr. Owen Harris    Mr\n",
       "1  Cumings, Mrs. John Bradley (Florence Briggs Th...   Mrs\n",
       "2                             Heikkinen, Miss. Laina  Miss\n",
       "3       Futrelle, Mrs. Jacques Heath (Lily May Peel)   Mrs\n",
       "4                           Allen, Mr. William Henry    Mr"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "def get_title(passenger):\n",
    "    # extracts the title from the name variable\n",
    "    line = passenger\n",
    "    if re.search('Mrs', line):\n",
    "        return 'Mrs'\n",
    "    elif re.search('Mr', line):\n",
    "        return 'Mr'\n",
    "    elif re.search('Miss', line):\n",
    "        return 'Miss'\n",
    "    elif re.search('Master', line):\n",
    "        return 'Master'\n",
    "    else:\n",
    "        return 'Other'\n",
    "    \n",
    "data['Title'] = data['Name'].apply(get_title)\n",
    "submission['Title'] = submission['Name'].apply(get_title)\n",
    "\n",
    "data[['Name', 'Title']].head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# drop the original variable\n",
    "data.drop(labels='Name', inplace=True, axis=1)\n",
    "submission.drop(labels='Name', inplace=True, axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1     0.602694\n",
      "2     0.180696\n",
      "3     0.114478\n",
      "4     0.032548\n",
      "6     0.024691\n",
      "5     0.016835\n",
      "7     0.013468\n",
      "11    0.007856\n",
      "8     0.006734\n",
      "Name: Family_size, dtype: float64\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x8b762a55c0>"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD/CAYAAAAKVJb/AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAD45JREFUeJzt3X+s3Xddx/Hna7eMMGCM2Ctgf9AaS5YZfgQuhcgSRmDY\nbcSCklhmBNHZ1FDBGI2NGIwhJlswUQyFpoFqiD8aQX4UVihGBVQg3A5rRzeKlzLXVhjlhyyDha7u\n7R/nO3I43vZ+b3t6z+1nz0fS3O/38/3k+32lPX31ez7nR1NVSJLactmkA0iSxs9yl6QGWe6S1CDL\nXZIaZLlLUoMsd0lqkOUuSQ2y3CWpQZa7JDXIcpekBq2Y1IVXrlxZ69atm9TlJemSdMcdd3yzqqYX\nmjexcl+3bh0HDx6c1OUl6ZKU5L/6zHNZRpIaZLlLUoMsd0lqkOUuSQ2y3CWpQb3KPcmmJEeTzCXZ\ncZY51yU5lORIkk+NN6YkaTEWfCtkkilgJ3A9cAKYTbKvqu4amnMV8E5gU1Xdm+THL1ZgSdLC+ty5\nbwTmqupYVZ0G9gKbR+bcDHygqu4FqKpvjDemJGkx+nyIaRVwfGj/BPCCkTnPAB6T5JPAE4G3V9V7\nxxFw3Y7bx3Ea7rn1prGcR5IuBeP6hOoK4HnAS4HHAZ9N8rmq+vLwpCRbga0Aa9euHdOlJUmj+izL\nnATWDO2v7saGnQAOVNX3quqbwKeBZ4+eqKp2V9VMVc1MTy/41Qi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PA8B9SZ5TVYcAquqBJK8A9gDPnFCm00muqKrvA897ZLBbR55IuXfF8KdJ\n3tf9vI/JPwZvAd6e5A8YfLHTZ5McZ/Atp7dMMNeTgDsYPK7rka/Q7l7TmdQNw49ct6oeYvDVI/uS\nXDGZSMwCn2L+35OrljjLI94DfInBM+c3A+9Lcgx4IbB3qUJccmvuSd4D/EVV/es8x/6mqm6eQKbV\nDO6Uvz7PsRdV1b9NINNjq+oH84yvBJ5WVXcudaZ5stwEvKiqfn8ZZLkSWM/gH5sTVXXfhCPNqyvR\np1TVVydw7WdU1ZeX+rrnkuSLwKuq6j/nOXa8qibyAnCSnwCoqv9OchXwMgbLxp9fsgyXWrlL0iOS\nvJrBaxD/7+vDk7yyqj40gVjLwqSfEkvSeauq95/j8JOXLMgy5J27pCYlubeq1k46x6R45y7pkrVM\n3z23LFjuki5ly/Hdc8uC5S7pUvZRBh8gPDR6IMknlz7O8uGauyQ1yC8Ok6QGWe6S1CDLXZIaZLlL\nUoMsd0lq0P8B6t0EmuIpZiYAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x8b762aacf8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# create a variable indicating family size (including the passenger)\n",
    "# sums siblings and parents\n",
    "\n",
    "data['Family_size'] = data['SibSp']+data['Parch']+1\n",
    "submission['Family_size'] = submission['SibSp']+submission['Parch']+1\n",
    "\n",
    "print(data.Family_size.value_counts()/ np.float(len(data)))\n",
    "\n",
    "(data.Family_size.value_counts() / np.float(len(data))).plot.bar()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The new variable Family size is discrete, because it is the sum of 2 discrete variables. It takes a finite number of values, and large families were rare on the Titanic. In fact, families larger than 7 people were rare, so I will **cap family size at 7**."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Sex</th>\n",
       "      <th>Parch</th>\n",
       "      <th>Age</th>\n",
       "      <th>is_mother</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>male</td>\n",
       "      <td>0</td>\n",
       "      <td>22.0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>female</td>\n",
       "      <td>0</td>\n",
       "      <td>38.0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>female</td>\n",
       "      <td>0</td>\n",
       "      <td>26.0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>female</td>\n",
       "      <td>0</td>\n",
       "      <td>35.0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>male</td>\n",
       "      <td>0</td>\n",
       "      <td>35.0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      Sex  Parch   Age  is_mother\n",
       "0    male      0  22.0          0\n",
       "1  female      0  38.0          0\n",
       "2  female      0  26.0          0\n",
       "3  female      0  35.0          0\n",
       "4    male      0  35.0          0"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# variable indicating if passenger was a mother\n",
    "data['is_mother'] = np.where((data.Sex =='female')&(data.Parch>=1)&(data.Age>18),1,0)\n",
    "submission['is_mother'] = np.where((submission.Sex =='female')&(submission.Parch>=1)&(submission.Age>18),1,0)\n",
    "\n",
    "data[['Sex', 'Parch', 'Age', 'is_mother']].head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Sex</th>\n",
       "      <th>Parch</th>\n",
       "      <th>Age</th>\n",
       "      <th>is_mother</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>female</td>\n",
       "      <td>2</td>\n",
       "      <td>27.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>female</td>\n",
       "      <td>5</td>\n",
       "      <td>38.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>88</th>\n",
       "      <td>female</td>\n",
       "      <td>2</td>\n",
       "      <td>23.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>98</th>\n",
       "      <td>female</td>\n",
       "      <td>1</td>\n",
       "      <td>34.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>136</th>\n",
       "      <td>female</td>\n",
       "      <td>2</td>\n",
       "      <td>19.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        Sex  Parch   Age  is_mother\n",
       "8    female      2  27.0          1\n",
       "25   female      5  38.0          1\n",
       "88   female      2  23.0          1\n",
       "98   female      1  34.0          1\n",
       "136  female      2  19.0          1"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.loc[data.is_mother==1, ['Sex', 'Parch', 'Age', 'is_mother']].head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "there were 64 mothers in the Titanic\n"
     ]
    }
   ],
   "source": [
    "print('there were {} mothers in the Titanic'.format(data.is_mother.sum()))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Types of problems within variables II (section 3)\n",
    "\n",
    "Let's look for missing data, outliers, cardinality and rare labels in the newly created variables.\n",
    "\n",
    "#### New numerical variables: Missing values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Cabin_numerical     0.775533\n",
       "Ticket_numerical    0.004489\n",
       "is_mother           0.000000\n",
       "Family_size         0.000000\n",
       "dtype: float64"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data[['Cabin_numerical', 'Ticket_numerical', 'is_mother', 'Family_size']].isnull().mean()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Cabin_numerical, as expected contains the same amount of missing data than the original variable Cabin. \n",
    "\n",
    "Ticket, also contains a small percentage of missing values. The other newly created variables do not contain missing data, as expected.\n",
    "\n",
    "#### New numerical variables: Outliers"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.text.Text at 0x8b7662d438>"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iV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H4P8Epg/qEr3wEubh5fBTxjke1cUlX3APckuatvG0u5qPm+Bbi+qm4HSPJ5ep8qfm2RjB+m\nVwhe2tSqewG39633LwfYtiRJAE8H/qyqvgVQVf/WN+3twAVVtfNDxCcARwH/2Iw/9wc+OeB2PtB8\nvwr4+QHm/0JVbQFIcj1wWVVVki3A2r75Lqyqfwf+vdl7eAy9QvCZwGebeR5Ir7D7EvDFqvrUgJml\nsbHAk3Z1PfD8RaadBDwUeHxVfTfJVmC/ZlrNm3f+c+gd+rmz/V4W//27p+/xzvl2sOse9/3Y1c5l\n7pu3/H1921koY+gVhE9cJMs3F2mXJGk5/gl4apKzqurb9MafS6vqhStY185xrn8sXWqcnD8u9o+Z\n/WPxYuPkb1XV2/snJFmLY6SmlIdoSrv6e2DfJBt2NiT5iST/F3AgcFdT3D0V+OG+5X4oyc4i6ReA\nTww5153Aw9K7itm+wHNWsI6FMt4MPHRne5J9kjxqKIklSXuaS4GX9J3jfUjftHcCHwIuSLI38Cng\nyUl+rJn3gHzvitXfAB60zG1vBR7XrOtxwBEryH9Ckv2aUxtmgU8DHwFemuSBzboPTfKwFaxbGhsL\nPKlPs4ftecDT07tNwvXAbwF30Dt3YH1zSMcvAjf1LXozcGqSG4GD6Z0XMMxc3wX+J3AFvQH0pqWX\nWND3Zayq79DbY/nbSa4BrgaeNJzUkqQ9SVV9mN4pA1cmuZp558dV1VvoHer458BXgVOA9ya5lt7h\nmT/ezLoZ+PBCF1lZwl8BhzTj9q+ygitfA9cCH6NXfL6pqv6lqv4O+Avgk834/36WX3xKY5XvHTEm\nSZIkSWoz9+BJkiRJUkdY4EmSJElSR1jgSZIkSVJHWOBJkiRJUkdY4EmSJElSR1jgSZIkSVJHWOBJ\nkiRJUkdY4EmSJElSR/z/jBOisTmCcygAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x8b762aaba8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# first we plot the distributions to find out if they are Gaussian or skewed.\n",
    "# Depending on the distribution, we will use the normal assumption or the interquantile\n",
    "# range to find outliers\n",
    "\n",
    "plt.figure(figsize=(15,6))\n",
    "plt.subplot(1, 2, 1)\n",
    "fig = data.Cabin_numerical.hist(bins=50)\n",
    "fig.set_ylabel('Number of passengers')\n",
    "fig.set_xlabel('Cabin number')\n",
    "\n",
    "plt.subplot(1, 2, 2)\n",
    "fig = data.Ticket_numerical.hist(bins=50)\n",
    "fig.set_ylabel('Number of passengers')\n",
    "fig.set_xlabel('Ticket number')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.text.Text at 0x8b767d8a90>"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA38AAAFpCAYAAAAsp5EgAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XuYZXV95/v3R26i3NHUIcDYHEVjQ7x2gIx5ZgowQIwj\nekYNJqNtQuzMI8dozCRALoOKTGBOlNE4knSEgMQIiHrgiIAtdMVEA9LgpblI6AgIHS5JNwJtFGn8\nnj/2r2RTVlXXpWvv6l7v1/PsZ6/1Xeu31rf62bj8rvVbv1+qCkmSJEnS9u1pw05AkiRJkrTwLP4k\nSZIkqQMs/iRJkiSpAyz+JEmSJKkDLP4kSZIkqQMs/iRJkiSpAyz+JEmSJKkDLP4kSZIkqQMs/iRJ\nkiSpA3YcdgLz8axnPauWLFky7DSkgfve977HM5/5zGGnIQ3UjTfe+K9V9exh57Gt8BqpLvL6qC6a\nzfVxmy7+lixZwpo1a4adhjRwY2NjjI6ODjsNaaCS3D3sHLYlXiPVRV4f1UWzuT7a7VOSJEmSOsDi\nT5IkSZI6wOJPkiRJkjrA4k+SJEmSOsDiT5IkSZI6wOJPkiRJkjrA4k+SJEmSOsDiT5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PW4gAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x8b762aacc0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# let's visualise outliers with the boxplot and whiskers\n",
    "plt.figure(figsize=(15,6))\n",
    "plt.subplot(1, 2, 1)\n",
    "fig = data.boxplot(column='Cabin_numerical')\n",
    "fig.set_title('')\n",
    "fig.set_ylabel('Cabin number')\n",
    "\n",
    "plt.subplot(1, 2, 2)\n",
    "fig = data.boxplot(column='Ticket_numerical')\n",
    "fig.set_title('')\n",
    "fig.set_ylabel('Ticket number')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Cabin_numerical does not contain outliers. Ticket_numerical seems to contain a few outliers. Let's find out more about it."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Ticket number outliers are values < -981730.0 or > 1343691.0\n",
      "Number of passengers with ticket values higher than 1343691.0: 0.04938271604938271\n"
     ]
    }
   ],
   "source": [
    "# Ticket numerical\n",
    "IQR = data.Ticket_numerical.quantile(0.75) - data.Ticket_numerical.quantile(\n",
    "    0.25)\n",
    "Lower_fence = data.Ticket_numerical.quantile(0.25) - (IQR * 3)\n",
    "Upper_fence = data.Ticket_numerical.quantile(0.75) + (IQR * 3)\n",
    "print(\n",
    "    'Ticket number outliers are values < {lowerboundary} or > {upperboundary}'.\n",
    "    format(lowerboundary=Lower_fence, upperboundary=Upper_fence))\n",
    "passengers = len(data[data.Ticket_numerical > Upper_fence]) / np.float(\n",
    "    len(data))\n",
    "print('Number of passengers with ticket values higher than {upperboundary}: {passengers}'.format(upperboundary=Upper_fence, \\\n",
    "                                                                                                 passengers=passengers))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "I will use equal width discretisation for this variable."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### New categorical variables: Missing values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Cabin_categorical     0.771044\n",
       "Ticket_categorical    0.000000\n",
       "Title                 0.000000\n",
       "dtype: float64"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data[['Cabin_categorical', 'Ticket_categorical', 'Title']].isnull().mean()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "As expected, Cabin contains the same amount of missing data as the original Cabin variable.\n",
    "\n",
    "The other 2 variables do not show missing data."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### New categorical variables: cardinality"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Cabin_categorical  contains  9  labels\n",
      "Ticket_categorical  contains  28  labels\n",
      "Title  contains  5  labels\n"
     ]
    }
   ],
   "source": [
    "for var in ['Cabin_categorical', 'Ticket_categorical', 'Title']:\n",
    "    print(var, ' contains ', len(data[var].unique()), ' labels')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Title and Cabin are not highly cardinal, Ticket on the other hand has quite a few labels. Let's explore the percentage of passengers within each label to identify rare labels.\n",
    "\n",
    "#### New categorical variables: rare labels"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "C    0.066218\n",
      "B    0.052750\n",
      "D    0.037037\n",
      "E    0.035915\n",
      "A    0.016835\n",
      "F    0.014590\n",
      "G    0.004489\n",
      "T    0.001122\n",
      "Name: Cabin_categorical, dtype: float64\n",
      "\n",
      "NAN        0.741863\n",
      "PC         0.067340\n",
      "CA         0.046016\n",
      "A          0.031425\n",
      "STONO      0.020202\n",
      "SOTONOQ    0.016835\n",
      "SCPARIS    0.012346\n",
      "WC         0.011223\n",
      "SOC        0.006734\n",
      "C          0.005612\n",
      "FCC        0.005612\n",
      "LINE       0.004489\n",
      "SCAH       0.003367\n",
      "WEP        0.003367\n",
      "SOPP       0.003367\n",
      "PP         0.003367\n",
      "PPP        0.002245\n",
      "SWPP       0.002245\n",
      "SOTONO     0.002245\n",
      "SC         0.001122\n",
      "AS         0.001122\n",
      "CASOTON    0.001122\n",
      "SCOW       0.001122\n",
      "FA         0.001122\n",
      "SCA        0.001122\n",
      "SOP        0.001122\n",
      "SP         0.001122\n",
      "FC         0.001122\n",
      "Name: Ticket_categorical, dtype: float64\n",
      "\n",
      "Mr        0.581369\n",
      "Miss      0.202020\n",
      "Mrs       0.144781\n",
      "Master    0.044893\n",
      "Other     0.026936\n",
      "Name: Title, dtype: float64\n",
      "\n"
     ]
    }
   ],
   "source": [
    "# rare / infrequent labels (less than 1% of passengers)\n",
    "for var in ['Cabin_categorical', 'Ticket_categorical', 'Title']:\n",
    "    print(data[var].value_counts() / np.float(len(data)))\n",
    "    print()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- Cabin contains the rare labels G and T: replace by most frequent category\n",
    "- Ticket contains a lot of infrequent labels: replace by rare\n",
    "- Title does not contain rare labels\n",
    "\n",
    "Because the number of passengers in the rare cabins is so small, grouping them into a new category called rare, will be in itself rare, and may be prone to over-fitting. This, in cabin, I will replace rare labels by the most frequent category.\n",
    "\n",
    "In ticket_categorical, on the other hand, the number of infrequent labels is high, therefore grouping them into a new label makes sense. "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Separate train and test set"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "((712, 16), (179, 16))"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Let's separate into train and test set\n",
    "\n",
    "X_train, X_test, y_train, y_test = train_test_split(data, data.Survived, test_size=0.2,\n",
    "                                                    random_state=0)\n",
    "X_train.shape, X_test.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# let's group again the variables into categorical or numerical\n",
    "# now considering the newly created variables\n",
    "\n",
    "def find_categorical_and_numerical_variables(dataframe):\n",
    "    cat_vars = [col for col in data.columns if data[col].dtypes == 'O']\n",
    "    num_vars  = [col for col in data.columns if data[col].dtypes != 'O']\n",
    "    return cat_vars, num_vars\n",
    "                 \n",
    "categorical, numerical = find_categorical_and_numerical_variables(data)       "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Sex', 'Embarked', 'Cabin_categorical', 'Ticket_categorical', 'Title']"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "categorical"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Pclass',\n",
       " 'Age',\n",
       " 'SibSp',\n",
       " 'Parch',\n",
       " 'Fare',\n",
       " 'Cabin_numerical',\n",
       " 'Ticket_numerical',\n",
       " 'Family_size',\n",
       " 'is_mother']"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "numerical = [var for var in numerical if var not in ['Survived','PassengerId']]\n",
    "numerical"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Engineering missing values in numerical variables (section 5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Age 0.198033707865\n",
      "Cabin_numerical 0.776685393258\n",
      "Ticket_numerical 0.00561797752809\n"
     ]
    }
   ],
   "source": [
    "# print variables with missing data\n",
    "for col in numerical:\n",
    "    if X_train[col].isnull().mean()>0:\n",
    "        print(col, X_train[col].isnull().mean())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- Age and ticket contains < 50% NA: create additional variable with NA + random sample imputation\n",
    "- Cabin_numerical contains > 50% NA: impute NA by value far in the distribution"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def impute_na(X_train, df, variable):\n",
    "    # make temporary df copy\n",
    "    temp = df.copy()\n",
    "    \n",
    "    # extract random from train set to fill the na\n",
    "    random_sample = X_train[variable].dropna().sample(temp[variable].isnull().sum(), random_state=0)\n",
    "    \n",
    "    # pandas needs to have the same index in order to merge datasets\n",
    "    random_sample.index = temp[temp[variable].isnull()].index\n",
    "    temp.loc[temp[variable].isnull(), variable] = random_sample\n",
    "    return temp[variable]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Age and ticket\n",
    "# add variable indicating missingness\n",
    "for df in [X_train, X_test, submission]:\n",
    "    for var in ['Age', 'Ticket_numerical']:\n",
    "        df[var+'_NA'] = np.where(df[var].isnull(), 1, 0)\n",
    "    \n",
    "# replace by random sampling\n",
    "for df in [X_train, X_test, submission]:\n",
    "    for var in ['Age', 'Ticket_numerical']:\n",
    "        df[var] = impute_na(X_train, df, var)\n",
    "    \n",
    "\n",
    "# Cabin numerical\n",
    "extreme = X_train.Cabin_numerical.mean() + X_train.Cabin_numerical.std()*3\n",
    "for df in [X_train, X_test, submission]:\n",
    "    df.Cabin_numerical.fillna(extreme, inplace=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Engineering Missing Data in categorical variables (section 6)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Embarked 0.00280898876404\n",
      "Cabin_categorical 0.77106741573\n"
     ]
    }
   ],
   "source": [
    "# print variables with missing data\n",
    "for col in categorical:\n",
    "    if X_train[col].isnull().mean()>0:\n",
    "        print(col, X_train[col].isnull().mean())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- Embarked NA imputed by most frequent category, because NA is low\n",
    "- Cabin_categorical imputed by 'Missing', because NA is high"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# add label indicating 'Missing' to Cabin categorical\n",
    "# or replace by most frequent label in Embarked\n",
    "\n",
    "for df in [X_train, X_test, submission]:\n",
    "    df['Embarked'].fillna(X_train['Embarked'].mode()[0], inplace=True)\n",
    "    df['Cabin_categorical'].fillna('Missing', inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "PassengerId            0\n",
       "Survived               0\n",
       "Pclass                 0\n",
       "Sex                    0\n",
       "Age                    0\n",
       "SibSp                  0\n",
       "Parch                  0\n",
       "Fare                   0\n",
       "Embarked               0\n",
       "Cabin_numerical        0\n",
       "Cabin_categorical      0\n",
       "Ticket_numerical       0\n",
       "Ticket_categorical     0\n",
       "Title                  0\n",
       "Family_size            0\n",
       "is_mother              0\n",
       "Age_NA                 0\n",
       "Ticket_numerical_NA    0\n",
       "dtype: int64"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# check absence of null values\n",
    "X_train.isnull().sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "PassengerId            0\n",
       "Survived               0\n",
       "Pclass                 0\n",
       "Sex                    0\n",
       "Age                    0\n",
       "SibSp                  0\n",
       "Parch                  0\n",
       "Fare                   0\n",
       "Embarked               0\n",
       "Cabin_numerical        0\n",
       "Cabin_categorical      0\n",
       "Ticket_numerical       0\n",
       "Ticket_categorical     0\n",
       "Title                  0\n",
       "Family_size            0\n",
       "is_mother              0\n",
       "Age_NA                 0\n",
       "Ticket_numerical_NA    0\n",
       "dtype: int64"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_test.isnull().sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "PassengerId            0\n",
       "Pclass                 0\n",
       "Sex                    0\n",
       "Age                    0\n",
       "SibSp                  0\n",
       "Parch                  0\n",
       "Fare                   1\n",
       "Embarked               0\n",
       "Cabin_numerical        0\n",
       "Cabin_categorical      0\n",
       "Ticket_numerical       0\n",
       "Ticket_categorical     0\n",
       "Title                  0\n",
       "Family_size            0\n",
       "is_mother              0\n",
       "Age_NA                 0\n",
       "Ticket_numerical_NA    0\n",
       "dtype: int64"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "submission.isnull().sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Fare in the submission dataset contains one null value, I will replace it by the median \n",
    "submission.Fare.fillna(X_train.Fare.median(), inplace=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Outliers in Numerical variables (section 8 and 15)\n",
    "\n",
    "As I was analysing the outliers at the beginning of the notebook, I was taking a note on the preprocessing that I thought would be more convenient for each one of them. The notes are summarised here:\n",
    "\n",
    "- Age: top-coding (73)\n",
    "- Fare: equal frequency binning\n",
    "- Sibsp: top-coding (4)\n",
    "- Parch: top-coding (2)\n",
    "- Family Size: top-coding (7)\n",
    "- Ticket_number: equal frequency binning"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def top_code(df, variable, top):\n",
    "    return np.where(df[variable]>top, top, df[variable])\n",
    "\n",
    "for df in [X_train, X_test, submission]:\n",
    "    df['Age'] = top_code(df, 'Age', 73)\n",
    "    df['SibSp'] = top_code(df, 'SibSp', 4)\n",
    "    df['Parch'] = top_code(df, 'Parch', 2)\n",
    "    df['Family_size'] = top_code(df, 'Family_size', 7)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Age  max value:  73.0\n",
      "SibSp  max value:  4\n",
      "Parch  max value:  2\n",
      "Family_size  max value:  7\n"
     ]
    }
   ],
   "source": [
    "# let's check that it worked\n",
    "for var in ['Age',  'SibSp', 'Parch', 'Family_size']:\n",
    "    print(var, ' max value: ', X_train[var].max())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Age  max value:  73.0\n",
      "SibSp  max value:  4\n",
      "Parch  max value:  2\n",
      "Family_size  max value:  7\n"
     ]
    }
   ],
   "source": [
    "# let's check that it worked\n",
    "for var in ['Age',  'SibSp', 'Parch', 'Family_size']:\n",
    "    print(var, ' max value: ', submission[var].max())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# find quantiles and discretise train set\n",
    "X_train['Fare'], bins = pd.qcut(x=X_train['Fare'], q=8, retbins=True, precision=3, duplicates='raise')\n",
    "X_test['Fare'] = pd.cut(x = X_test['Fare'], bins=bins, include_lowest=True)\n",
    "submission['Fare'] = pd.cut(x = submission['Fare'], bins=bins, include_lowest=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 56,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "submission.Fare.isnull().sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x8b766495c0>"
      ]
     },
     "execution_count": 57,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAswAAAHBCAYAAAB9p+1ZAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3Xu4XWV97v3vTQiEiAJCqkDABAQkEgQMqEVb0GpB+hq1\narHiAXWnHhCtW0u08Fbt3n3Rsi3QImxExDN2g1Z2QUW34OFVhACRgxwMiBAOElCQgyiH3/5jjsTF\nIozMtTLXGpkr38915cqY4zDXb41rzDnv9cxnPE+qCkmSJEmrt0HXBUiSJEnrMgOzJEmS1MLALEmS\nJLUwMEuSJEktDMySJElSCwOzJEmS1MLALEmSJLUwMEuSJEktDMySJElSiw27LmB1ttpqq5ozZ07X\nZUiSJGkKu/jii++oqllr2m+dDMxz5sxhyZIlXZchSZKkKSzJL/rZzy4ZkiRJUgsDsyRJktTCwCxJ\nkiS1WCf7MEuSJE11Dz74IMuXL+eBBx7oupQpb8aMGcyePZvp06eP63gDsyRJUgeWL1/OE5/4RObM\nmUOSrsuZsqqKO++8k+XLlzN37txxPYddMiRJkjrwwAMPsOWWWxqWJ1gSttxyy7VqyTcwS5IkdcSw\nPDnW9jwbmCVJkqQW9mGWJElaB8xZfPZAn++Gow9q3X7XXXfxxS9+kXe84x1jet6XvvSlfPGLX2Tz\nzTdfm/KGii3MkiRJ66G77rqLT3ziE49Z/9BDD7Ued84556xXYRlsYZYkSVovLV68mOuuu4499tiD\n6dOnM2PGDLbYYguuvvpqrr32Wl7+8pdz00038cADD/Dud7+bRYsWATBnzhyWLFnCvffey4EHHsjz\nn/98fvjDH7Ltttvyta99jU022aTj32zwbGGWJElaDx199NHsuOOOLF26lH/+53/mkksu4bjjjuPa\na68F4NRTT+Xiiy9myZIlHH/88dx5552PeY6f/exnvPOd7+TKK69k880358wzz5zsX2NS2MIsSZIk\n9tlnn0eNU3z88cfz1a9+FYCbbrqJn/3sZ2y55ZaPOmbu3LnsscceADz72c/mhhtumLR6J5OBWZIk\nSTzhCU9YtXz++efz7W9/mx/96EfMnDmT/fbbb7XjGG+88carlqdNm8Zvf/vbSal1shmYJ8D8z8wf\n13GXv/HyAVciSZK0ek984hO55557Vrvt7rvvZosttmDmzJlcffXVXHDBBZNc3brFwCxJkrQOWNMw\ncIO25ZZbsu+++7LbbruxySab8JSnPGXVtgMOOICTTjqJXXfdlV122YXnPve5k1rbusbALEmStJ76\n4he/uNr1G2+8MV//+tdXu21lP+WtttqKK664YtX6973vfQOvb13hKBmSJElSCwOzJEmS1MLALEmS\nJLUwMEuSJEktDMySJElSCwOzJEmS1MJh5SRJktYFH9pswM93d+vmu+66iy9+8Yu84x3vGPNTH3vs\nsSxatIiZM2eOt7qh0ldgTnIAcBwwDTilqo4etf0ZwKeBvYC/r6pjRmzbHDgF2A0o4M1V9aPBlC9J\n0hQ33hC1hrAk3XXXXXziE58Yd2A+5JBDDMwrJZkGnAC8GFgOXJTkrKr66YjdfgUcDrx8NU9xHPCN\nqnpVko2A9ePMSpIkrcMWL17Mddddxx577MGLX/xi/uiP/oh///d/53e/+x2veMUr+PCHP8x9993H\na17zGpYvX87DDz/MUUcdxS9/+UtuueUW9t9/f7baaivOO++8rn+VCddPC/M+wLKquh4gyenAQmBV\nYK6q24HbkzxqTsckmwF/Aryp2e/3wO8HUrkkSZLG7eijj+aKK65g6dKlnHvuuZxxxhlceOGFVBUv\ne9nL+N73vseKFSvYZpttOPvsswG4++672Wyzzfj4xz/Oeeedx1ZbbdXxbzE5+rnpb1vgphGPlzfr\n+jEXWAF8OsmlSU5J8oQx1ihJkqQJdO6553Luueey5557stdee3H11Vfzs5/9jPnz5/Otb32LI444\ngu9///tsttmA+1kPiYkeJWNDev2aT6yqPYH7gMWr2zHJoiRLkixZsWLFBJclSZKklaqKD3zgAyxd\nupSlS5eybNky3vKWt7DzzjtzySWXMH/+fI488kg+8pGPdF1qJ/oJzDcD2414PLtZ14/lwPKq+nHz\n+Ax6AfoxqurkqlpQVQtmzZrV59NLkiRpPJ74xCdyzz33APDnf/7nnHrqqdx7770A3Hzzzdx+++3c\ncsstzJw5k0MOOYT3v//9XHLJJY85dn3QTx/mi4CdksylF5QPBv66nyevqtuS3JRkl6q6BngRI/o+\nS5IkqTHJI5tsueWW7Lvvvuy2224ceOCB/PVf/zXPe97zANh00035/Oc/z7Jly3j/+9/PBhtswPTp\n0znxxBMBWLRoEQcccADbbLPNenHTX6pqzTslLwWOpTes3KlV9d+TvA2gqk5K8lRgCfAk4BHgXmBe\nVf0myR70hpXbCLgeOLSqft328xYsWFBLlixZi1+rW/M/M39cx13+xssHXIkkaeg5rNyUddVVV7Hr\nrrt2XcZ6Y3XnO8nFVbVgTcf2NQ5zVZ0DnDNq3Ukjlm+j11VjdccuBdZYiCRJkrQuWm9m+puz+Owx\nH3PD0QeteSdJkiRNaetNYB6X8X4NNnf7wdYhSZKkzkz0sHKSJEnSUDMwS5IkSS0MzJIkSVIL+zBL\nkiStA8Y7LO3jGfRwtR/60IfYdNNNed/73jeu40866SRmzpzJG97whr6PueWWWzj88MM544wzxvUz\nB8XALEmSpAn3tre9bczHbLPNNp2HZbBLhiRJ0nrrvvvu46CDDuJZz3oWu+22G1/+8peZM2cOd9xx\nBwBLlixhv/32W7X/T37yE573vOex00478clPfhKA888/nz/90z9l4cKF7LDDDixevJgvfOEL7LPP\nPsyfP5/rrrsO6LVQH3PMMQAcf/zxzJs3j913352DDz4YgO9+97vsscce7LHHHuy5557cc8893HDD\nDey2224APPDAAxx66KHMnz+fPffcc9UMg6eddhqvfOUrOeCAA9hpp534u7/7u4GfJ1uYJUmS1lPf\n+MY32GabbTj77N58FXfffTdHHHHE4+5/2WWXccEFF3Dfffex5557ctBBvTkrfvKTn3DVVVfx5Cc/\nmR122IG3vvWtXHjhhRx33HH867/+K8cee+yjnufoo4/m5z//ORtvvDF33XUXAMcccwwnnHAC++67\nL/feey8zZsx41DEnnHACSbj88su5+uqreclLXsK1114LwNKlS7n00kvZeOON2WWXXXjXu97Fdttt\nN7DzZAuzJEnSemr+/Pl861vf4ogjjuD73/8+m23WPgfFwoUL2WSTTdhqq63Yf//9ufDCCwHYe++9\n2Xrrrdl4443ZcccdeclLXrLq+W+44YbHPM/uu+/O6173Oj7/+c+z4Ya99tt9992X9773vRx//PHc\nddddq9av9IMf/IBDDjkEgGc84xk87WlPWxWYX/SiF7HZZpsxY8YM5s2bxy9+8Yu1Oi+jGZglSZLW\nUzvvvDOXXHIJ8+fP58gjj+QjH/kIG264IY888gjQ6wYxUpLVPt54441Xrdtggw1WPd5ggw146KGH\nHvNzzz77bN75zndyySWXsPfee/PQQw+xePFiTjnlFH7729+y7777cvXVV/f9e4z8+dOmTVvtz1wb\nBmZJkqT11C233MLMmTM55JBDeP/7388ll1zCnDlzuPjiiwE488wzH7X/1772NR544AHuvPNOzj//\nfPbee+8x/8xHHnmEm266if3335+PfvSj3H333dx7771cd911zJ8/nyOOOIK99977MYH5BS94AV/4\nwhcAuPbaa7nxxhvZZZddxvmbj419mCVJktYBgx4Grq+fefnlvP/972eDDTZg+vTpnHjiifz2t7/l\nLW95C0cdddSjbviDXleK/fffnzvuuIOjjjqKbbbZZlW3iH49/PDDHHLIIdx9991UFYcffjibb745\nRx11FOeddx4bbLABz3zmMznwwAO59dZbVx33jne8g7e//e3Mnz+fDTfckNNOO+1RLcsTKVU1KT9o\nLBYsWFBLliwZ6HPOWXz2mI+5YcZfj+tnzZ+7/biO6+KFIklax32ovU/p4x9392Dr0MBdddVV7Lrr\nrl2Xsd5Y3flOcnFVLVjTsXbJkCRJkloYmCVJkqQWBmZJkqSOrItdY6eitT3PBmZJkqQOzJgxgzvv\nvNPQPMGqijvvvPMxE6GMhaNkSJIkdWD27NksX76cFStWdF3KlDdjxgxmz5497uMNzJIkSR2YPn06\nc+fO7boM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pK7bd8lOZ8/V5V/G2McJnmY5EXb90leJjmzsi4BNoRr5QAA\nYIYVZgAAmCEwAwDADIEZAABmCMwAADBDYAYAgBkCMwAAzBCYAQBghsAMAAAzfgLkegd8QOq8DgAA\nAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x8b76839ef0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "t1 = X_train.groupby(['Fare'])['Fare'].count() / np.float(len(X_train))\n",
    "t2 = X_test.groupby(['Fare'])['Fare'].count() / np.float(len(X_test))\n",
    "t3 = submission.groupby(['Fare'])['Fare'].count() / np.float(len(submission))\n",
    "\n",
    "temp = pd.concat([t1,t2,t3], axis=1)\n",
    "temp.columns = ['train', 'test', 'submission']\n",
    "temp.plot.bar(figsize=(12,6))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# find quantiles and discretise train set\n",
    "X_train['Ticket_numerical'], bins = pd.qcut(x=X_train['Ticket_numerical'], q=8, retbins=True, precision=3, duplicates='raise')\n",
    "X_test['Ticket_numerical'] = pd.cut(x = X_test['Ticket_numerical'], bins=bins, include_lowest=True)\n",
    "submission['Ticket_numerical_temp'] = pd.cut(x = submission['Ticket_numerical'], bins=bins, include_lowest=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_test.Ticket_numerical.isnull().sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2"
      ]
     },
     "execution_count": 60,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "submission.Ticket_numerical_temp.isnull().sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Ticket_numerical</th>\n",
       "      <th>Ticket_numerical_temp</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>186</th>\n",
       "      <td>2.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>302</th>\n",
       "      <td>2.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     Ticket_numerical Ticket_numerical_temp\n",
       "186               2.0                   NaN\n",
       "302               2.0                   NaN"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "submission[submission.Ticket_numerical_temp.isnull()][['Ticket_numerical', 'Ticket_numerical_temp']]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "There are 2 values of ticket in the submission dataset, that could not be placed within the intervals calculated for the training set. let's look at the intervals to understand why this could have been the case."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[(2.999, 2816.875], (14737.5, 24421.875], (364848.0, 3101317.0], (24421.875, 113053.0], (248701.0, 347077.25], (113053.0, 248701.0], (2816.875, 14737.5], (347077.25, 364848.0]]\n",
       "Categories (8, interval[float64]): [(2.999, 2816.875] < (2816.875, 14737.5] < (14737.5, 24421.875] < (24421.875, 113053.0] < (113053.0, 248701.0] < (248701.0, 347077.25] < (347077.25, 364848.0] < (364848.0, 3101317.0]]"
      ]
     },
     "execution_count": 62,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# inspect the ticket bins in training set\n",
    "X_train.Ticket_numerical.unique()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The lowest bin starts at 2.99, and the values for the tickets in the submission are 2, so slight below the interval. I will bottom code then that variable, and include those 2 values within the lowest interval. See below."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Interval(2.9990000000000001, 2816.875, closed='right')"
      ]
     },
     "execution_count": 63,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_train.Ticket_numerical.unique()[0]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "There are 2 Ticket numerical parts in the submission dataset that are lower than any other in the training set. This I will include those in the lowest interval [2.99-2816]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 64,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "submission.loc[submission.Ticket_numerical_temp.isnull(), 'Ticket_numerical_temp'] = X_train.Ticket_numerical.unique()[0]\n",
    "submission.Ticket_numerical_temp.isnull().sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>PassengerId</th>\n",
       "      <th>Pclass</th>\n",
       "      <th>Sex</th>\n",
       "      <th>Age</th>\n",
       "      <th>SibSp</th>\n",
       "      <th>Parch</th>\n",
       "      <th>Fare</th>\n",
       "      <th>Embarked</th>\n",
       "      <th>Cabin_numerical</th>\n",
       "      <th>Cabin_categorical</th>\n",
       "      <th>Ticket_numerical</th>\n",
       "      <th>Ticket_categorical</th>\n",
       "      <th>Title</th>\n",
       "      <th>Family_size</th>\n",
       "      <th>is_mother</th>\n",
       "      <th>Age_NA</th>\n",
       "      <th>Ticket_numerical_NA</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>892</td>\n",
       "      <td>3</td>\n",
       "      <td>male</td>\n",
       "      <td>34.5</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>(7.75, 7.918]</td>\n",
       "      <td>Q</td>\n",
       "      <td>158.222059</td>\n",
       "      <td>Missing</td>\n",
       "      <td>(248701.0, 347077.25]</td>\n",
       "      <td>NAN</td>\n",
       "      <td>Mr</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>893</td>\n",
       "      <td>3</td>\n",
       "      <td>female</td>\n",
       "      <td>47.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>(-0.001, 7.75]</td>\n",
       "      <td>S</td>\n",
       "      <td>158.222059</td>\n",
       "      <td>Missing</td>\n",
       "      <td>(347077.25, 364848.0]</td>\n",
       "      <td>NAN</td>\n",
       "      <td>Mrs</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>894</td>\n",
       "      <td>2</td>\n",
       "      <td>male</td>\n",
       "      <td>62.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>(7.918, 10.353]</td>\n",
       "      <td>Q</td>\n",
       "      <td>158.222059</td>\n",
       "      <td>Missing</td>\n",
       "      <td>(113053.0, 248701.0]</td>\n",
       "      <td>NAN</td>\n",
       "      <td>Mr</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>895</td>\n",
       "      <td>3</td>\n",
       "      <td>male</td>\n",
       "      <td>27.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>(7.918, 10.353]</td>\n",
       "      <td>S</td>\n",
       "      <td>158.222059</td>\n",
       "      <td>Missing</td>\n",
       "      <td>(248701.0, 347077.25]</td>\n",
       "      <td>NAN</td>\n",
       "      <td>Mr</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>896</td>\n",
       "      <td>3</td>\n",
       "      <td>female</td>\n",
       "      <td>22.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>(10.353, 14.456]</td>\n",
       "      <td>S</td>\n",
       "      <td>158.222059</td>\n",
       "      <td>Missing</td>\n",
       "      <td>(364848.0, 3101317.0]</td>\n",
       "      <td>NAN</td>\n",
       "      <td>Mrs</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   PassengerId  Pclass     Sex   Age  SibSp  Parch              Fare Embarked  \\\n",
       "0          892       3    male  34.5      0      0     (7.75, 7.918]        Q   \n",
       "1          893       3  female  47.0      1      0    (-0.001, 7.75]        S   \n",
       "2          894       2    male  62.0      0      0   (7.918, 10.353]        Q   \n",
       "3          895       3    male  27.0      0      0   (7.918, 10.353]        S   \n",
       "4          896       3  female  22.0      1      1  (10.353, 14.456]        S   \n",
       "\n",
       "   Cabin_numerical Cabin_categorical       Ticket_numerical  \\\n",
       "0       158.222059           Missing  (248701.0, 347077.25]   \n",
       "1       158.222059           Missing  (347077.25, 364848.0]   \n",
       "2       158.222059           Missing   (113053.0, 248701.0]   \n",
       "3       158.222059           Missing  (248701.0, 347077.25]   \n",
       "4       158.222059           Missing  (364848.0, 3101317.0]   \n",
       "\n",
       "  Ticket_categorical Title  Family_size  is_mother  Age_NA  \\\n",
       "0                NAN    Mr            1          0       0   \n",
       "1                NAN   Mrs            2          0       0   \n",
       "2                NAN    Mr            1          0       0   \n",
       "3                NAN    Mr            1          0       0   \n",
       "4                NAN   Mrs            3          1       0   \n",
       "\n",
       "   Ticket_numerical_NA  \n",
       "0                    0  \n",
       "1                    0  \n",
       "2                    0  \n",
       "3                    0  \n",
       "4                    0  "
      ]
     },
     "execution_count": 65,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "submission['Ticket_numerical'] = submission['Ticket_numerical_temp']\n",
    "submission.drop(labels=['Ticket_numerical_temp'], inplace=True, axis=1)\n",
    "submission.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Engineering rare labels in categorical variables (section 9)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Sex male      0.65309\n",
      "female    0.34691\n",
      "Name: Sex, dtype: float64\n",
      "\n",
      "Embarked S    0.728933\n",
      "C    0.181180\n",
      "Q    0.089888\n",
      "Name: Embarked, dtype: float64\n",
      "\n",
      "Cabin_categorical Missing    0.771067\n",
      "C          0.061798\n",
      "B          0.050562\n",
      "E          0.040730\n",
      "D          0.036517\n",
      "A          0.021067\n",
      "F          0.012640\n",
      "G          0.004213\n",
      "T          0.001404\n",
      "Name: Cabin_categorical, dtype: float64\n",
      "\n",
      "Ticket_categorical NAN        0.728933\n",
      "PC         0.066011\n",
      "CA         0.050562\n",
      "A          0.035112\n",
      "STONO      0.023876\n",
      "SOTONOQ    0.016854\n",
      "SCPARIS    0.014045\n",
      "WC         0.014045\n",
      "SOC        0.007022\n",
      "C          0.005618\n",
      "LINE       0.005618\n",
      "PP         0.004213\n",
      "WEP        0.004213\n",
      "PPP        0.002809\n",
      "SOPP       0.002809\n",
      "FCC        0.002809\n",
      "SCAH       0.002809\n",
      "SOTONO     0.002809\n",
      "AS         0.001404\n",
      "SCOW       0.001404\n",
      "FA         0.001404\n",
      "FC         0.001404\n",
      "SCA        0.001404\n",
      "SP         0.001404\n",
      "SWPP       0.001404\n",
      "Name: Ticket_categorical, dtype: float64\n",
      "\n",
      "Title Mr        0.589888\n",
      "Miss      0.200843\n",
      "Mrs       0.140449\n",
      "Master    0.049157\n",
      "Other     0.019663\n",
      "Name: Title, dtype: float64\n",
      "\n"
     ]
    }
   ],
   "source": [
    "# find unfrequent labels in categorical variables\n",
    "for var in categorical:\n",
    "    print(var, X_train[var].value_counts()/np.float(len(X_train)))\n",
    "    print()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- Cabin contains the rare labels G and T: replace by most frequent category\n",
    "- Ticket contains a lot of infrequent labels: replace by rare\n",
    "\n",
    "Because the number of passengers in the rare cabins is so small, grouping them into a new category called rare, will be in itself rare, and may be prone to over-fitting. Thus, in cabin, I will replace rare labels by the most frequent category.\n",
    "In ticket_categorical, on the other hand, the number of infrequent labels is high, therefore grouping them into a new label makes sense."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def rare_imputation(variable, which='rare'):    \n",
    "    # find frequent labels\n",
    "    temp = X_train.groupby([variable])[variable].count()/np.float(len(X_train))\n",
    "    frequent_cat = [x for x in temp.loc[temp>0.01].index.values]\n",
    "    \n",
    "    # create new variables, with Rare labels imputed\n",
    "    if which=='frequent':\n",
    "        # find the most frequent category\n",
    "        mode_label = X_train.groupby(variable)[variable].count().sort_values().tail(1).index.values[0]\n",
    "        X_train[variable] = np.where(X_train[variable].isin(frequent_cat), X_train[variable], mode_label)\n",
    "        X_test[variable] = np.where(X_test[variable].isin(frequent_cat), X_test[variable], mode_label)\n",
    "        submission[variable] = np.where(submission[variable].isin(frequent_cat), submission[variable], mode_label)\n",
    "    \n",
    "    else:\n",
    "        X_train[variable] = np.where(X_train[variable].isin(frequent_cat), X_train[variable], 'Rare')\n",
    "        X_test[variable] = np.where(X_test[variable].isin(frequent_cat), X_test[variable], 'Rare')\n",
    "        submission[variable] = np.where(submission[variable].isin(frequent_cat), submission[variable], 'Rare')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "rare_imputation('Cabin_categorical', 'frequent')\n",
    "rare_imputation('Ticket_categorical', 'rare')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Sex male      0.65309\n",
      "female    0.34691\n",
      "Name: Sex, dtype: float64\n",
      "\n",
      "Embarked S    0.728933\n",
      "C    0.181180\n",
      "Q    0.089888\n",
      "Name: Embarked, dtype: float64\n",
      "\n",
      "Cabin_categorical Missing    0.776685\n",
      "C          0.061798\n",
      "B          0.050562\n",
      "E          0.040730\n",
      "D          0.036517\n",
      "A          0.021067\n",
      "F          0.012640\n",
      "Name: Cabin_categorical, dtype: float64\n",
      "\n",
      "Ticket_categorical NAN        0.728933\n",
      "PC         0.066011\n",
      "Rare       0.050562\n",
      "CA         0.050562\n",
      "A          0.035112\n",
      "STONO      0.023876\n",
      "SOTONOQ    0.016854\n",
      "WC         0.014045\n",
      "SCPARIS    0.014045\n",
      "Name: Ticket_categorical, dtype: float64\n",
      "\n",
      "Title Mr        0.589888\n",
      "Miss      0.200843\n",
      "Mrs       0.140449\n",
      "Master    0.049157\n",
      "Other     0.019663\n",
      "Name: Title, dtype: float64\n",
      "\n"
     ]
    }
   ],
   "source": [
    "# let's check that it worked\n",
    "for var in categorical:\n",
    "    print(var, X_train[var].value_counts()/np.float(len(X_train)))\n",
    "    print()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Sex male      0.636364\n",
      "female    0.363636\n",
      "Name: Sex, dtype: float64\n",
      "\n",
      "Embarked S    0.645933\n",
      "C    0.244019\n",
      "Q    0.110048\n",
      "Name: Embarked, dtype: float64\n",
      "\n",
      "Cabin_categorical Missing    0.784689\n",
      "C          0.083732\n",
      "B          0.043062\n",
      "D          0.031100\n",
      "E          0.021531\n",
      "F          0.019139\n",
      "A          0.016746\n",
      "Name: Cabin_categorical, dtype: float64\n",
      "\n",
      "Ticket_categorical NAN        0.708134\n",
      "PC         0.076555\n",
      "Rare       0.064593\n",
      "CA         0.064593\n",
      "A          0.026316\n",
      "SOTONOQ    0.021531\n",
      "SCPARIS    0.019139\n",
      "WC         0.011962\n",
      "STONO      0.007177\n",
      "Name: Ticket_categorical, dtype: float64\n",
      "\n",
      "Title Mr        0.574163\n",
      "Miss      0.186603\n",
      "Mrs       0.172249\n",
      "Master    0.050239\n",
      "Other     0.016746\n",
      "Name: Title, dtype: float64\n",
      "\n"
     ]
    }
   ],
   "source": [
    "# let's check that it worked\n",
    "for var in categorical:\n",
    "    print(var, submission[var].value_counts()/np.float(len(submission)))\n",
    "    print()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Encode categorical variables (section 10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Sex', 'Embarked', 'Cabin_categorical', 'Ticket_categorical', 'Title']"
      ]
     },
     "execution_count": 71,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "categorical"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- Sex: one hot encoding\n",
    "- Remaining variables: replace by risk probability"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "for df in [X_train, X_test, submission]:\n",
    "    df['Sex']  = pd.get_dummies(df.Sex, drop_first=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0, 1], dtype=uint64)"
      ]
     },
     "execution_count": 73,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_train.Sex.unique()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1, 0], dtype=uint64)"
      ]
     },
     "execution_count": 74,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_test.Sex.unique()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1, 0], dtype=uint64)"
      ]
     },
     "execution_count": 75,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "submission.Sex.unique()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def encode_categorical_variables(var, target):\n",
    "        # make label to risk dictionary\n",
    "        ordered_labels = X_train.groupby([var])[target].mean().to_dict()\n",
    "        \n",
    "        # encode variables\n",
    "        X_train[var] = X_train[var].map(ordered_labels)\n",
    "        X_test[var] = X_test[var].map(ordered_labels)\n",
    "        submission[var] = submission[var].map(ordered_labels)\n",
    "\n",
    "# enccode labels in categorical vars\n",
    "for var in categorical:\n",
    "    encode_categorical_variables(var, 'Survived')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# parse discretised variables to object before encoding\n",
    "for df in [X_train, X_test, submission]:\n",
    "    df.Fare = df.Fare.astype('O')\n",
    "    df.Ticket_numerical = df.Ticket_numerical.astype('O')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Fare\n",
      "Ticket_numerical\n"
     ]
    }
   ],
   "source": [
    "# encode labels\n",
    "for var in ['Fare', 'Ticket_numerical']:\n",
    "    print(var)\n",
    "    encode_categorical_variables(var, 'Survived')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>PassengerId</th>\n",
       "      <th>Survived</th>\n",
       "      <th>Pclass</th>\n",
       "      <th>Sex</th>\n",
       "      <th>Age</th>\n",
       "      <th>SibSp</th>\n",
       "      <th>Parch</th>\n",
       "      <th>Fare</th>\n",
       "      <th>Embarked</th>\n",
       "      <th>Cabin_numerical</th>\n",
       "      <th>Cabin_categorical</th>\n",
       "      <th>Ticket_numerical</th>\n",
       "      <th>Ticket_categorical</th>\n",
       "      <th>Title</th>\n",
       "      <th>Family_size</th>\n",
       "      <th>is_mother</th>\n",
       "      <th>Age_NA</th>\n",
       "      <th>Ticket_numerical_NA</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>140</th>\n",
       "      <td>141</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>0.744939</td>\n",
       "      <td>27.0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0.397849</td>\n",
       "      <td>0.527132</td>\n",
       "      <td>158.222059</td>\n",
       "      <td>0.307414</td>\n",
       "      <td>0.348315</td>\n",
       "      <td>0.394990</td>\n",
       "      <td>0.790000</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>439</th>\n",
       "      <td>440</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0.191398</td>\n",
       "      <td>31.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.404494</td>\n",
       "      <td>0.342967</td>\n",
       "      <td>158.222059</td>\n",
       "      <td>0.307414</td>\n",
       "      <td>0.573034</td>\n",
       "      <td>0.305556</td>\n",
       "      <td>0.157143</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>817</th>\n",
       "      <td>818</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0.191398</td>\n",
       "      <td>31.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.494118</td>\n",
       "      <td>0.527132</td>\n",
       "      <td>158.222059</td>\n",
       "      <td>0.307414</td>\n",
       "      <td>0.348315</td>\n",
       "      <td>0.500000</td>\n",
       "      <td>0.157143</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>378</th>\n",
       "      <td>379</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>0.191398</td>\n",
       "      <td>20.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.223214</td>\n",
       "      <td>0.527132</td>\n",
       "      <td>158.222059</td>\n",
       "      <td>0.307414</td>\n",
       "      <td>0.348315</td>\n",
       "      <td>0.394990</td>\n",
       "      <td>0.157143</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>491</th>\n",
       "      <td>492</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>0.191398</td>\n",
       "      <td>21.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.223214</td>\n",
       "      <td>0.342967</td>\n",
       "      <td>158.222059</td>\n",
       "      <td>0.307414</td>\n",
       "      <td>0.306818</td>\n",
       "      <td>0.166667</td>\n",
       "      <td>0.157143</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     PassengerId  Survived  Pclass       Sex   Age  SibSp  Parch      Fare  \\\n",
       "140          141         0       3  0.744939  27.0      0      2  0.397849   \n",
       "439          440         0       2  0.191398  31.0      0      0  0.404494   \n",
       "817          818         0       2  0.191398  31.0      1      1  0.494118   \n",
       "378          379         0       3  0.191398  20.0      0      0  0.223214   \n",
       "491          492         0       3  0.191398  21.0      0      0  0.223214   \n",
       "\n",
       "     Embarked  Cabin_numerical  Cabin_categorical  Ticket_numerical  \\\n",
       "140  0.527132       158.222059           0.307414          0.348315   \n",
       "439  0.342967       158.222059           0.307414          0.573034   \n",
       "817  0.527132       158.222059           0.307414          0.348315   \n",
       "378  0.527132       158.222059           0.307414          0.348315   \n",
       "491  0.342967       158.222059           0.307414          0.306818   \n",
       "\n",
       "     Ticket_categorical     Title  Family_size  is_mother  Age_NA  \\\n",
       "140            0.394990  0.790000            3          0       1   \n",
       "439            0.305556  0.157143            1          0       0   \n",
       "817            0.500000  0.157143            3          0       0   \n",
       "378            0.394990  0.157143            1          0       0   \n",
       "491            0.166667  0.157143            1          0       0   \n",
       "\n",
       "     Ticket_numerical_NA  \n",
       "140                    0  \n",
       "439                    0  \n",
       "817                    0  \n",
       "378                    0  \n",
       "491                    0  "
      ]
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#let's inspect the dataset\n",
    "X_train.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can see that the labels how now been replaced by the survival probability.\n",
    "\n",
    "### Feature scaling (section 13)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>PassengerId</th>\n",
       "      <th>Survived</th>\n",
       "      <th>Pclass</th>\n",
       "      <th>Sex</th>\n",
       "      <th>Age</th>\n",
       "      <th>SibSp</th>\n",
       "      <th>Parch</th>\n",
       "      <th>Fare</th>\n",
       "      <th>Embarked</th>\n",
       "      <th>Cabin_numerical</th>\n",
       "      <th>Cabin_categorical</th>\n",
       "      <th>Ticket_numerical</th>\n",
       "      <th>Ticket_categorical</th>\n",
       "      <th>Title</th>\n",
       "      <th>Family_size</th>\n",
       "      <th>is_mother</th>\n",
       "      <th>Age_NA</th>\n",
       "      <th>Ticket_numerical_NA</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>712.000000</td>\n",
       "      <td>712.000000</td>\n",
       "      <td>712.000000</td>\n",
       "      <td>712.000000</td>\n",
       "      <td>712.000000</td>\n",
       "      <td>712.000000</td>\n",
       "      <td>712.000000</td>\n",
       "      <td>712.000000</td>\n",
       "      <td>712.000000</td>\n",
       "      <td>712.000000</td>\n",
       "      <td>712.000000</td>\n",
       "      <td>712.000000</td>\n",
       "      <td>712.000000</td>\n",
       "      <td>712.000000</td>\n",
       "      <td>712.000000</td>\n",
       "      <td>712.000000</td>\n",
       "      <td>712.000000</td>\n",
       "      <td>712.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>443.283708</td>\n",
       "      <td>0.383427</td>\n",
       "      <td>2.317416</td>\n",
       "      <td>0.383427</td>\n",
       "      <td>29.807584</td>\n",
       "      <td>0.484551</td>\n",
       "      <td>0.353933</td>\n",
       "      <td>0.383427</td>\n",
       "      <td>0.383427</td>\n",
       "      <td>133.956178</td>\n",
       "      <td>0.383427</td>\n",
       "      <td>0.383427</td>\n",
       "      <td>0.383427</td>\n",
       "      <td>0.383427</td>\n",
       "      <td>1.875000</td>\n",
       "      <td>0.067416</td>\n",
       "      <td>0.198034</td>\n",
       "      <td>0.005618</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>260.003783</td>\n",
       "      <td>0.486563</td>\n",
       "      <td>0.833767</td>\n",
       "      <td>0.263664</td>\n",
       "      <td>14.496489</td>\n",
       "      <td>0.907718</td>\n",
       "      <td>0.673811</td>\n",
       "      <td>0.144616</td>\n",
       "      <td>0.071238</td>\n",
       "      <td>48.398112</td>\n",
       "      <td>0.149408</td>\n",
       "      <td>0.118238</td>\n",
       "      <td>0.098434</td>\n",
       "      <td>0.276532</td>\n",
       "      <td>1.460148</td>\n",
       "      <td>0.250917</td>\n",
       "      <td>0.398798</td>\n",
       "      <td>0.074795</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.191398</td>\n",
       "      <td>0.670000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.212121</td>\n",
       "      <td>0.342967</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.307414</td>\n",
       "      <td>0.166667</td>\n",
       "      <td>0.080000</td>\n",
       "      <td>0.157143</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>211.750000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.191398</td>\n",
       "      <td>21.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.232770</td>\n",
       "      <td>0.342967</td>\n",
       "      <td>158.222059</td>\n",
       "      <td>0.307414</td>\n",
       "      <td>0.321087</td>\n",
       "      <td>0.394990</td>\n",
       "      <td>0.157143</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>441.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>0.191398</td>\n",
       "      <td>28.750000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.397849</td>\n",
       "      <td>0.342967</td>\n",
       "      <td>158.222059</td>\n",
       "      <td>0.307414</td>\n",
       "      <td>0.370787</td>\n",
       "      <td>0.394990</td>\n",
       "      <td>0.157143</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>671.250000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>0.744939</td>\n",
       "      <td>38.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.444444</td>\n",
       "      <td>0.421875</td>\n",
       "      <td>158.222059</td>\n",
       "      <td>0.307414</td>\n",
       "      <td>0.474719</td>\n",
       "      <td>0.394990</td>\n",
       "      <td>0.706294</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>890.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>0.744939</td>\n",
       "      <td>73.000000</td>\n",
       "      <td>4.000000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.659091</td>\n",
       "      <td>0.527132</td>\n",
       "      <td>158.222059</td>\n",
       "      <td>0.758621</td>\n",
       "      <td>0.573034</td>\n",
       "      <td>0.617021</td>\n",
       "      <td>0.790000</td>\n",
       "      <td>7.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       PassengerId    Survived      Pclass         Sex         Age  \\\n",
       "count   712.000000  712.000000  712.000000  712.000000  712.000000   \n",
       "mean    443.283708    0.383427    2.317416    0.383427   29.807584   \n",
       "std     260.003783    0.486563    0.833767    0.263664   14.496489   \n",
       "min       1.000000    0.000000    1.000000    0.191398    0.670000   \n",
       "25%     211.750000    0.000000    2.000000    0.191398   21.000000   \n",
       "50%     441.000000    0.000000    3.000000    0.191398   28.750000   \n",
       "75%     671.250000    1.000000    3.000000    0.744939   38.000000   \n",
       "max     890.000000    1.000000    3.000000    0.744939   73.000000   \n",
       "\n",
       "            SibSp       Parch        Fare    Embarked  Cabin_numerical  \\\n",
       "count  712.000000  712.000000  712.000000  712.000000       712.000000   \n",
       "mean     0.484551    0.353933    0.383427    0.383427       133.956178   \n",
       "std      0.907718    0.673811    0.144616    0.071238        48.398112   \n",
       "min      0.000000    0.000000    0.212121    0.342967         2.000000   \n",
       "25%      0.000000    0.000000    0.232770    0.342967       158.222059   \n",
       "50%      0.000000    0.000000    0.397849    0.342967       158.222059   \n",
       "75%      1.000000    0.000000    0.444444    0.421875       158.222059   \n",
       "max      4.000000    2.000000    0.659091    0.527132       158.222059   \n",
       "\n",
       "       Cabin_categorical  Ticket_numerical  Ticket_categorical       Title  \\\n",
       "count         712.000000        712.000000          712.000000  712.000000   \n",
       "mean            0.383427          0.383427            0.383427    0.383427   \n",
       "std             0.149408          0.118238            0.098434    0.276532   \n",
       "min             0.307414          0.166667            0.080000    0.157143   \n",
       "25%             0.307414          0.321087            0.394990    0.157143   \n",
       "50%             0.307414          0.370787            0.394990    0.157143   \n",
       "75%             0.307414          0.474719            0.394990    0.706294   \n",
       "max             0.758621          0.573034            0.617021    0.790000   \n",
       "\n",
       "       Family_size   is_mother      Age_NA  Ticket_numerical_NA  \n",
       "count   712.000000  712.000000  712.000000           712.000000  \n",
       "mean      1.875000    0.067416    0.198034             0.005618  \n",
       "std       1.460148    0.250917    0.398798             0.074795  \n",
       "min       1.000000    0.000000    0.000000             0.000000  \n",
       "25%       1.000000    0.000000    0.000000             0.000000  \n",
       "50%       1.000000    0.000000    0.000000             0.000000  \n",
       "75%       2.000000    0.000000    0.000000             0.000000  \n",
       "max       7.000000    1.000000    1.000000             1.000000  "
      ]
     },
     "execution_count": 80,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_train.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "variables_that_need_scaling = ['Pclass', 'Age', 'Sibsp', 'Parch', 'Cabin_numerical', 'Family_size']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Pclass',\n",
       " 'Sex',\n",
       " 'Age',\n",
       " 'SibSp',\n",
       " 'Parch',\n",
       " 'Fare',\n",
       " 'Embarked',\n",
       " 'Cabin_numerical',\n",
       " 'Cabin_categorical',\n",
       " 'Ticket_numerical',\n",
       " 'Ticket_categorical',\n",
       " 'Title',\n",
       " 'Family_size',\n",
       " 'is_mother',\n",
       " 'Age_NA',\n",
       " 'Ticket_numerical_NA']"
      ]
     },
     "execution_count": 82,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "training_vars = [var for var in X_train.columns if var not in ['PassengerId', 'Survived']]\n",
    "training_vars"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "MinMaxScaler(copy=True, feature_range=(0, 1))"
      ]
     },
     "execution_count": 83,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# fit scaler\n",
    "scaler = MinMaxScaler() # create an instance\n",
    "scaler.fit(X_train[training_vars]) #  fit  the scaler to the train set and then transform it"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The scaler is now ready, we can use it in a machine learning algorithm when required. See below.\n",
    "\n",
    "### Machine Learning algorithm building\n",
    "\n",
    "#### xgboost"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "xgb train roc-auc: 0.9388929218086394\n",
      "xgb test roc-auc: 0.9077733860342556\n"
     ]
    }
   ],
   "source": [
    "xgb_model = xgb.XGBClassifier()\n",
    "\n",
    "eval_set = [(X_test[training_vars], y_test)]\n",
    "xgb_model.fit(X_train[training_vars], y_train, eval_metric=\"auc\", eval_set=eval_set, verbose=False)\n",
    "\n",
    "pred = xgb_model.predict_proba(X_train[training_vars])\n",
    "print('xgb train roc-auc: {}'.format(roc_auc_score(y_train, pred[:,1])))\n",
    "pred = xgb_model.predict_proba(X_test[training_vars])\n",
    "print('xgb test roc-auc: {}'.format(roc_auc_score(y_test, pred[:,1])))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Random Forests"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "RF train roc-auc: 0.9982310779577295\n",
      "RF test roc-auc: 0.8945981554677207\n"
     ]
    }
   ],
   "source": [
    "rf_model = RandomForestClassifier()\n",
    "rf_model.fit(X_train[training_vars], y_train)\n",
    "\n",
    "pred = rf_model.predict_proba(X_train[training_vars])\n",
    "print('RF train roc-auc: {}'.format(roc_auc_score(y_train, pred[:,1])))\n",
    "pred = rf_model.predict_proba(X_test[training_vars])\n",
    "print('RF test roc-auc: {}'.format(roc_auc_score(y_test, pred[:,1])))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Adaboost"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adaboost train roc-auc: 0.8973441137450249\n",
      "Adaboost test roc-auc: 0.8706192358366273\n"
     ]
    }
   ],
   "source": [
    "ada_model = AdaBoostClassifier()\n",
    "ada_model.fit(X_train[training_vars], y_train)\n",
    "\n",
    "pred = ada_model.predict_proba(X_train[training_vars])\n",
    "print('Adaboost train roc-auc: {}'.format(roc_auc_score(y_train, pred[:,1])))\n",
    "pred = ada_model.predict_proba(X_test[training_vars])\n",
    "print('Adaboost test roc-auc: {}'.format(roc_auc_score(y_test, pred[:,1])))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Logistic regression"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Logit train roc-auc: 0.8724915934483133\n",
      "Logit test roc-auc: 0.8268774703557312\n"
     ]
    }
   ],
   "source": [
    "logit_model = LogisticRegression()\n",
    "logit_model.fit(scaler.transform(X_train[training_vars]), y_train)\n",
    "\n",
    "pred = logit_model.predict_proba(scaler.transform(X_train[training_vars]))\n",
    "print('Logit train roc-auc: {}'.format(roc_auc_score(y_train, pred[:,1])))\n",
    "pred = ada_model.predict_proba(scaler.transform(X_test[training_vars]))\n",
    "print('Logit test roc-auc: {}'.format(roc_auc_score(y_test, pred[:,1])))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Select threshold for maximum accuracy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Ensemble test roc-auc: 0.9106719367588931\n"
     ]
    }
   ],
   "source": [
    "pred_ls = []\n",
    "for model in [xgb_model, rf_model, ada_model, logit_model]:\n",
    "    pred_ls.append(pd.Series(model.predict_proba(X_test[training_vars])[:,1]))\n",
    "\n",
    "final_pred = pd.concat(pred_ls, axis=1).mean(axis=1)\n",
    "print('Ensemble test roc-auc: {}'.format(roc_auc_score(y_test,final_pred)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 0.62887334,  0.57844404,  0.57404189,  0.56136034,  0.5611278 ,\n",
       "        0.52896941,  0.52819212,  0.51329908,  0.51176485,  0.46151215,\n",
       "        0.42590368,  0.4157962 ,  0.40317914,  0.38411698,  0.37637827,\n",
       "        0.3716263 ,  0.36255445,  0.35742418,  0.35366244,  0.34411429,\n",
       "        0.33705063,  0.33621705,  0.32975272,  0.3228687 ,  0.32075407,\n",
       "        0.32020933,  0.30779934,  0.30114494,  0.28647033,  0.27682098,\n",
       "        0.25926278,  0.24921405,  0.23840703,  0.23403145,  0.22316067,\n",
       "        0.22203072,  0.21961142,  0.21952678,  0.18889223,  0.1883331 ,\n",
       "        0.18169372,  0.1797722 ,  0.17787358,  0.15210567,  0.15075582,\n",
       "        0.14506151,  0.14492661,  0.14479344,  0.14448713,  0.14272373,\n",
       "        0.14182324,  0.14054127,  0.13657478,  0.13573485,  0.1332098 ,\n",
       "        0.13034344,  0.12988231])"
      ]
     },
     "execution_count": 89,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tpr, tpr, thresholds = metrics.roc_curve(y_test, final_pred)\n",
    "thresholds"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>thresholds</th>\n",
       "      <th>accuracy</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>0.461512</td>\n",
       "      <td>0.843575</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>0.371626</td>\n",
       "      <td>0.843575</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>0.376378</td>\n",
       "      <td>0.843575</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>0.384117</td>\n",
       "      <td>0.837989</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>0.337051</td>\n",
       "      <td>0.837989</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    thresholds  accuracy\n",
       "9     0.461512  0.843575\n",
       "15    0.371626  0.843575\n",
       "14    0.376378  0.843575\n",
       "13    0.384117  0.837989\n",
       "20    0.337051  0.837989"
      ]
     },
     "execution_count": 90,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "accuracy_ls = []\n",
    "for thres in thresholds:\n",
    "    y_pred = np.where(final_pred>thres,1,0)\n",
    "    accuracy_ls.append(metrics.accuracy_score(y_test, y_pred, normalize=True))\n",
    "    \n",
    "accuracy_ls = pd.concat([pd.Series(thresholds), pd.Series(accuracy_ls)],\n",
    "                        axis=1)\n",
    "accuracy_ls.columns = ['thresholds', 'accuracy']\n",
    "accuracy_ls.sort_values(by='accuracy', ascending=False, inplace=True)\n",
    "accuracy_ls.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Submission to Kaggle"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "pred_ls = []\n",
    "for model in [xgb_model, rf_model, ada_model, logit_model]:\n",
    "    pred_ls.append(pd.Series(model.predict_proba(submission[training_vars])[:,1]))\n",
    "\n",
    "final_pred = pd.concat(pred_ls, axis=1).mean(axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "final_pred = pd.Series(np.where(final_pred>0.40,1,0))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 93,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>PassengerId</th>\n",
       "      <th>Survived</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>892</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>893</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>894</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>895</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>896</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   PassengerId  Survived\n",
       "0          892         0\n",
       "1          893         0\n",
       "2          894         0\n",
       "3          895         0\n",
       "4          896         0"
      ]
     },
     "execution_count": 93,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "temp = pd.concat([submission.PassengerId, final_pred], axis=1)\n",
    "temp.columns = ['PassengerId', 'Survived']\n",
    "temp.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 94,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "temp.to_csv('submit_titanic.csv', index=False)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Feature importance"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 95,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x8b76bbeb70>"
      ]
     },
     "execution_count": 95,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAtMAAAHHCAYAAAB9W9QhAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\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AAAYEMU0AAAAMCCKaQAAAGBAFNMAAADAgP4B\n+HbXsxyHFcEAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x8b76bad630>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "importance = pd.Series(rf_model.feature_importances_)\n",
    "importance.index = training_vars\n",
    "importance.sort_values(inplace=True, ascending=False)\n",
    "importance.plot.bar(figsize=(12,6))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x8b76cf6668>"
      ]
     },
     "execution_count": 96,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAswAAAHHCAYAAACr/g5EAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmcJXV1///Xm2FRUUQFN3YVUFxQHBEjXyMaE3HDGIkg\n7gsSN4gxCahRgwkao0Y0RiQqETfUn2JQUcQFFZHIgAREUQmigAugoLiwen5/VF3mTk93dc/Qc6tu\nz+v5ePRjuqpu9Zzp6b516lPncz6pKiRJkiTNboO+A5AkSZKGzIRZkiRJ6mDCLEmSJHUwYZYkSZI6\nmDBLkiRJHUyYJUmSpA4mzJIkSVIHE2ZJkiSpgwmzJEmS1GHDvgOYzRZbbFHbb79932FIkiRpCTvz\nzDOvqKot53vdIBPm7bffnhUrVvQdhiRJkpawJD9ayOssyZAkSZI6mDBLkiRJHUyYJUmSpA4mzJIk\nSVIHE2ZJkiSpw4IS5iSPTvK9JBckOXSW4/skOSfJ2UlWJNlzoedKkiRJQzZvwpxkGfAOYG9gF2D/\nJLvMeNkXgV2r6v7Ac4B3r8G5kiRJ0mAtZIR5d+CCqrqwqq4DjgP2GX9BVf2mqqrd3BSohZ4rSZIk\nDdlCEuatgIvHti9p960iyZ8nOR/4DM0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n8CqaPvufBx4KPKuqTploHCbM6jJbBwJpCPzZXFzT0rlH0vonyR1o5lYEOL2qrph0DE7603weOf9L\npF54t7+4pqVzj6T1SJLDq+oXVfWZqvo08MskH5x0HNYwq1NV/bLvGKQ5OCF1cU1L5x5J65dtkhxW\nVa9vW4h+FPjWpINwhFnStBpNSL3NHB9aMyuSPH/mzgF27pG0fnkOcN8khwGfAk6pqtdOOghrmCVN\nJSekLq4kdwKOp+l3ulrnnqr6WV+xSVr/JBl/f98IeBfwdeA9AFV11kTjMWGWNI2c9LduDL1zj6T1\nQ5IvdxyuqnrExILBhFnSlEpye2vsJUmTYA2zpKlksixJS1+SI5JsPrZ9uyQTXxrbhFmSJElDtXdV\nXTXaqKorgcdMOggTZkmSJA3VsradHADtMtmbdLx+nbAPsyRJkobqg8AXkxzTbj8beN+kg3DSnyRJ\nkgYryd6sXHn45Ko6aeIxmDBLkiRJc7MkQ5IkSYOS5NSq2jPJ1cD46G5o+jBvNsl4TJglSZI0NJsC\nVNVt+g4E7JIhSZKk4RlUzbAjzJIkSRqaOyZ52VwHq+otkwzGhFmSJElDswy4NU3Ncu/skiFJkqRB\nSXJWVe3Wdxwj1jBLkiRpaAYxsjziCLMkSZIGJcntq+qXfccxYsIsSZIkdbAkQ5IkSepgwixJkiR1\nMGGWJEmSOpgwS5IkSR1MmCVJkqQO/z9OZ7ryOs6bMQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x8b76d01668>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "importance = pd.Series(xgb_model.feature_importances_)\n",
    "importance.index = training_vars\n",
    "importance.sort_values(inplace=True, ascending=False)\n",
    "importance.plot.bar(figsize=(12,6))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 97,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x8b76f6ff28>"
      ]
     },
     "execution_count": 97,
     "metadata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qiSHV9XPq+rjVfUx4BdJ3tV3XZJWL+cYS5uuWelOMPiFbVX1i75rWKW2S3JoVb2ya9X3\nfuBrfRclafVyxFjadK1N8vS5JwfYnWC0sO2G83xo9XoKcKckhwIfBU6uqpf1W5Kk1cw5xtImKsnN\ngeNpfWI36k5QVT/uq7Zxs7iwTddMkvF/7y2BNwNfBN4CUFVn9FGXpNXPYCxt4obencCFbZueJJ9b\n4OGqqn2nVoykTYrBWNKgJbmJc3glSdPgHGNJg2Yo3nQlOSLJ1mPHN07iltCSVozBWJI0VPtV1cWj\ng6r6JbB/j/VIWuUMxpKkodq8a9MGQLc99LUXeL4kXSP2MZYkDdW7gM8kObY7fjLw9h7rkbTKufhO\nkjRYSfZj/c6CJ1XVJ/usR9LqZjCWJEmScCqFJGlgkpxaVXsluQwYH70JrY/xVj2VJmmVMxhLkobm\n+gBV5ZbfkqbKrhSSpKFxjp+kXjhiLEkampslef58D1bVa6dZjKRNh8FYkjQ0mwM3oM0plqSpsSuF\nJGlQkpxRVbv3XYekTY9zjCVJQ+NIsaReOGIsSRqUJDepql/0XYekTY/BWJIkScKpFJIkSRJgMJYk\nSZIAg7EkSZIEGIwlSZIkwGAsSZIkAfD/AyYw36NaL2MjAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x8b76f1c780>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "importance = pd.Series(np.abs(logit_model.coef_.ravel()))\n",
    "importance.index = training_vars\n",
    "importance.sort_values(inplace=True, ascending=False)\n",
    "importance.plot.bar(figsize=(12,6))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.1"
  },
  "toc": {
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "toc_cell": false,
   "toc_position": {
    "height": "583px",
    "left": "0px",
    "right": "1324px",
    "top": "107px",
    "width": "326px"
   },
   "toc_section_display": "block",
   "toc_window_display": true
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
